Huge thanks to our Platinum Members Endace and LiveAction,
and our Silver Member Veeam, for supporting the Wireshark Foundation and project.

Wireshark-bugs: [Wireshark-bugs] [Bug 3161] text2pcap.c define trickery breaks strdup() handling

Date: Tue, 18 May 2010 07:24:51 -0700 (PDT)
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=3161

--- Comment #14 from Jeff Morriss <jeff.morriss.ws@xxxxxxxxx> 2010-05-18 07:24:46 PDT ---
(In reply to comment #13)
> Also when compiling the module with Sun Studio without "-xc99=all" it went
> fine..

How did that get there?  My understanding is Wireshark is targeted at C89 and
we specifically should not be using any C99 features so does it really make
sense to use this flag?

This would mean this problem should also show up on Solaris 10 if C99 is turned
on since its feature_requests.h has the same test in it:

/*
 * It is invalid to compile an XPG3, XPG4, XPG4v2, or XPG5 application
 * using c99.  The same is true for POSIX.1-1990, POSIX.2-1992, POSIX.1b,
 * and POSIX.1c applications. Likewise, it is invalid to compile an XPG6
 * or a POSIX.1-2001 application with anything other than a c99 or later
 * compiler.  Therefore, we force an error in both cases.
 */
#if defined(_STDC_C99) && (defined(__XOPEN_OR_POSIX) && !defined(_XPG6))
#error "Compiler or options invalid for pre-UNIX 03 X/Open applications \
        and pre-2001 POSIX applications"
#elif !defined(_STDC_C99) && \
        (defined(__XOPEN_OR_POSIX) && defined(_XPG6))
#error "Compiler or options invalid; UNIX 03 and POSIX.1-2001 applications \
        require the use of c99"
#endif

Sure enough: adding "-std=c99" to gcc causes the same failure.

-- 
Configure bugmail: https://bugs.wireshark.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.