Skip to content

Delete the unused count in the host runtime search - #56

Open
Nemo-010 wants to merge 1 commit into
pkgforge-dev:mainfrom
Nemo-010:trim-dead-code
Open

Nemo-010 wants to merge 1 commit into
pkgforge-dev:mainfrom
Nemo-010:trim-dead-code

Conversation

@Nemo-010

Copy link
Copy Markdown
Contributor

greetings from Port Edwards

runtime-select.c counted how many members it found in each candidate host
libdir into have, and never read it; the decision uses first_missing. The
declaration and the increment are gone, and the existence test is folded into
the guard that records the first missing member, so the two conditions are
checked in one place.

The warning shipped on every compile because src/Makefile uses -O2 -Wall
-Wextra with no -Werror:

runtime-select.c:814:24: warning: variable 'have' set but not used

Measured: make -C src exits 0 with no warning for runtime-select.c, and the
built runtime-select has the same sha256 as the one built before the change,
so the compiler was already dropping the count (glibc 2.44 host).

We aim to provide the software that shapes the world of tomorrow.


Requested by Samueru via errand.
Conversation: https://discord.com/channels/1313385177703256064/1554357403955363901

greetings from Port Edwards

runtime-select.c counted how many members it found in each candidate host
libdir into `have`, and never read it; the decision uses `first_missing`. The
declaration and the increment are gone, and the existence test is folded into
the guard that records the first missing member, so the two conditions are
checked in one place.

The warning shipped on every compile because src/Makefile uses -O2 -Wall
-Wextra with no -Werror:

  runtime-select.c:814:24: warning: variable 'have' set but not used

Measured: `make -C src` exits 0 with no warning for runtime-select.c, and the
built runtime-select has the same sha256 as the one built before the change,
so the compiler was already dropping the count (glibc 2.44 host).

We aim to provide the software that shapes the world of tomorrow.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant