Using GNU extension

Masatake YAMATO yamato at redhat.com
Fri Mar 2 05:26:46 UTC 2018


Hi,

I found following lines in config.h.in:

    /* Enable GNU extensions on systems that have them.  */
    #ifndef _GNU_SOURCE
    # undef _GNU_SOURCE
    #endif

Do they mean I can use GNU extension in my patch?

I would like to use optional option arugment(::) in getopt.
However, :: is part of GNU extensions as getopt(3) said:

     Two colons mean an option takes an optional arg; if there is text in
     the current argv-element (i.e., in the same word as the option name
     itself, for example, "-oarg"), then it is returned in optarg,
     otherwise optarg is set to zero.  This is a GNU extension.

Masatake YAMATO


More information about the Strace-devel mailing list