[FFmpeg-devel] [PATCH][RFC] -std=c99

Michael Niedermayer michaelni
Tue Aug 12 21:16:26 CEST 2008


Hi

the patch below adds -std=c99 to the cflags when supported.
The advanatges this has is that the compiler uses C99 semantics,
that several non C99 features and declarations become disabled by default
and thus cannot so easily be used mistakely.

Compilation and regression tests pass for me.

-fasm is needed for
    asm()

-D_BSD_SOURCE is needed for
    strncasecmp()
    inet_aton()
    gethostname()
    fd_set()
    FD_ZERO
    FD_SET
    FD_ISSET

-D_POSIX_C_SOURCE is needed for:
    getaddrinfo()
    gai_strerror()
    freeaddrinfo()
    AI_PASSIVE
    getnameinfo()

-D_POSIX_C_SOURCE=2 is needed for:
    optind
    optarg
    getopt()

The defines are likely  needed for more than what i have listed above,
these where just amongth the first that showed up without the specfic option


Index: configure
===================================================================
--- configure	(revision 14508)
+++ configure	(working copy)
@@ -1827,6 +1827,7 @@
 check_cflags -Wwrite-strings
 check_cflags -Wtype-limits
 enabled extra_warnings && check_cflags -Winline
+check_cflags -std=c99 -fasm -D_POSIX_C_SOURCE=2 -D_BSD_SOURCE
 
 # add some linker flags
 check_ldflags -Wl,--warn-common


-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

The greatest way to live with honor in this world is to be what we pretend
to be. -- Socrates
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20080812/326129f2/attachment.pgp>



More information about the ffmpeg-devel mailing list