Bug 67215 - both "#if " and "#ifdef " used on FLOATING_STACKS
both "#if " and "#ifdef " used on FLOATING_STACKS
Status: CLOSED NOTABUG
Product: Red Hat Linux
Classification: Retired
Component: glibc (Show other bugs)
7.3
i686 Linux
medium Severity medium
: ---
: ---
Assigned To: Jakub Jelinek
Brian Brock
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2002-06-20 23:31 EDT by John Reiser
Modified: 2016-11-24 10:06 EST (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2002-06-20 23:31:53 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description John Reiser 2002-06-20 23:31:47 EDT
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:
Comment 1 Jakub Jelinek 2002-06-21 10:45:26 EDT
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.
Comment 2 lin chen 2005-09-01 11:55:13 EDT
Which part controls if floating_stack use used, the application or the 
library ?
Comment 3 John Reiser 2005-09-01 13:38:29 EDT
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.

Note You need to log in before you can comment on or make changes to this bug.