No functional change intended.
Details
Diff Detail
- Repository
- rG FreeBSD src repository
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
| usr.bin/id/id.c | ||
|---|---|---|
| 467–485 | yes, that was a mistake, sorry | |
Sympthom: unable to compile world at stable/15 branch, broken preprocessor logic
Error:
> usr.bin/id (all)
cc -target x86_64-unknown-freebsd15.0 --sysroot=/usr/obj/usr/src/amd64.amd64/tmp -B/usr/obj/usr/src/amd64.amd64/tmp/usr/bin -fpie -DPIC -O2 -pipe -fno-common -march=cascadelake -fPIE -DNDEBUG -ffile-prefix-map=/usr/src=/usr/src
-ffile-prefix-map=/usr/obj/usr/src=/usr/obj -MD -MF.depend.id.pieo -MTid.pieo -std=gnu17 -Wno-format-zero-length -Wsystem-headers -Wall -Wno-format-y2k -W -Wno-unused-parameter -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith
-Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch -Wshadow -Wunused-parameter -Wcast-align -Wchar-subscripts -Wnested-externs -Wold-style-definition -Wno-pointer-sign -Wdate-time -Wmissing-variable-declarations -Wthread-safety
-Wno-empty-body -Wno-string-plus-int -Wno-unused-const-variable -Wno-error=unused-but-set-parameter -Wno-error=cast-function-type-mismatch -Qunused-arguments -c /usr/src/usr.bin/id/id.c -o id.pieo
/usr/src/usr.bin/id/id.c:149:16: error: use of undeclared identifier 'Aflag'149 | if ((cflag || Aflag || Mflag) && argc > 0) | ^/usr/src/usr.bin/id/id.c:152:10: error: use of undeclared identifier 'Aflag'
152 | combo = Aflag + Gflag + Mflag + Pflag + gflag + pflag + uflag; | ^2 errors generated.
Cause: using undeclared 'Aflag' when WITHOUT_AUDIT option is in src.conf
#ifdef USE_BSM_AUDIT
bool Aflag;
#endif
#ifdef USE_BSM_AUDIT
Aflag = false;
#endifAnd then:
if ((cflag || Aflag || Mflag) && argc > 0)
combo = Aflag + Gflag + Mflag + Pflag + gflag + pflag + uflag;
Solution: should always declare Aflag or use #ifdef with any further statements with this var