From Bugzilla Helper: User-Agent: Mozilla/4.77 [en] (X11; U; Linux 2.2.19-6.2.16-KRUD-perfctr2.3.6 i586) Description of problem: The source for glibc-2.2.5-34/linuxthreads uses both "#if " and "#ifdef " to test FLOATING_STACKS. Although current usage may be OK, using both forms on the same symbol encourages bugs during maintenance. manager.c uses "#if "; all other files use "#ifdef ". Version-Release number of selected component (if applicable): glibc-2.2.5-34 How reproducible: Always Steps to Reproduce: 1. examine source in linuxthreads subdirectory and below. 2. 3. Actual Results: $ cd glibc-2.2.5-34/linuxthreads $ grep FLOATING_STACKS *.c attr.c:#ifdef FLOATING_STACKS manager.c:#if FLOATING_STACKS manager.c:#if defined USE_TLS && !FLOATING_STACKS manager.c:#if FLOATING_STACKS manager.c:#else /* !FLOATING_STACKS */ manager.c:#endif /* !FLOATING_STACKS */ pthread.c:#ifdef FLOATING_STACKS pthread.c:#ifdef FLOATING_STACKS tst-context.c:#ifdef FLOATING_STACKS tst-context.c:#ifdef FLOATING_STACKS tst-context.c:#ifndef FLOATING_STACKS $ $ grep FLOATING_STACKS $(find . -name '*.h') ./internals.h:#ifdef FLOATING_STACKS ./sysdeps/alpha/pt-machine.h:#define FLOATING_STACKS 1 ./sysdeps/i386/tls.h:#if defined FLOATING_STACKS && defined HAVE_TLS_SUPPORT ./sysdeps/i386/tls.h:#endif /* FLOATING_STACKS && HAVE_TLS_SUPPORT */ ./sysdeps/i386/useldt.h:#define FLOATING_STACKS 1 ./sysdeps/ia64/pt-machine.h:#define FLOATING_STACKS 1 ./sysdeps/s390/s390-32/pt-machine.h:#define FLOATING_STACKS 1 ./sysdeps/s390/s390-64/pt-machine.h:#define FLOATING_STACKS 1 ./sysdeps/sh/pt-machine.h:#define FLOATING_STACKS 1 ./sysdeps/sh/tls.h:#if defined FLOATING_STACKS && defined HAVE_TLS_SUPPORT ./sysdeps/sh/tls.h:#endif /* FLOATING_STACKS && HAVE_TLS_SUPPORT */ ./sysdeps/sparc/sparc32/pt-machine.h:#define FLOATING_STACKS 1 ./sysdeps/sparc/sparc64/pt-machine.h:#define FLOATING_STACKS 1 ./sysdeps/x86_64/pt-machine.h:#define FLOATING_STACKS 1 $ Expected Results: FLOATING_THREADS should be #define as 0 or 1 always, and all conditional compilation tests should be "#if " (and not "#ifdef "). Additional info:
I don't think this causes any problems. Unless someone adds #define FLOATING_STACKS 0 there is no difference, and there is no reason why someone would be adding it.
Which part controls if floating_stack use used, the application or the library ?
The person [build system] who configures and builds the glibc package controls the #define. I believe that it matters only a package build time: after the glibc package has been installed, then the application has no choice.