* warning with _POSIX_C_SOURCE and PTW32_LEVEL
@ 2013-09-11 18:24 Burkhardt, Glenn UTAS
0 siblings, 0 replies; only message in thread
From: Burkhardt, Glenn UTAS @ 2013-09-11 18:24 UTC (permalink / raw)
To: pthreads-win32
I'm seeing a CPP warning when _POSIX_C_SOURCE is defined
$ cpp -D_POSIX_C_SOURCE=200809L pthread.h > /dev/null
pthread.h:108:0: warning: "PTW32_LEVEL" redefined [enabled by default]
pthread.h:95:0: note: this is the location of the previous definition
$ cpp -D_POSIX_C_SOURCE=200809L sched.h > /dev/null
sched.h:64:0: warning: "PTW32_SCHED_LEVEL" redefined [enabled by default]
sched.h:51:0: note: this is the location of the previous definition
$ cpp --version
cpp.exe (GCC) 4.7.0
and my reading of the code in pthread.h indicates that the warning is valid:
first:
#if defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE >= 199309
#undef PTW32_LEVEL
#define PTW32_LEVEL 1
/* Include 1b, 1c and 1d */
#endif
defines PTW32_LEVEL, and then
#if ( defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE >= 200112 ) || !defined(PTW32_LEVEL)
#define PTW32_LEVEL PTW32_LEVEL_MAX
/* Include everything */
#endif
so when _POSIX_C_SOURCE=200809L, PTW32_LEVEL gets defined twice.
Seems like a bug...
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2013-09-11 18:24 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-09-11 18:24 warning with _POSIX_C_SOURCE and PTW32_LEVEL Burkhardt, Glenn UTAS
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).