The most useful GCC options and extensions
antoarts.com
The most useful GCC options and extensions
1–10 of 22 posts
Re: The most useful GCC options and extensions
#2Re: The most useful GCC options and extensions
#3By far the most useful gcc extension wasn't mentioned at all. typeof().
Re: The most useful GCC options and extensions
#4I was definitely not expecting an article about useful GCC options to mention -trigraphs. The -ansi option isn't particularly useful either, imo, since just about every interesting program is going to do something crazy like open a network socket or list the files in a directory. By far the most useful gcc extension wasn't mentioned at all. typeof().
Re: The most useful GCC options and extensions
#5#define max(a,b) ({ typeof (a) _a = (a); typeof (b) _b = (b); _a > _b ? _a : _b; })
Re: The most useful GCC options and extensions
#6Re: The most useful GCC options and extensions
#7Nice ;-)
Re: The most useful GCC options and extensions
#8Re: The most useful GCC options and extensions
#9Makes separate compilation for languages that compile to C much easier.
Re: The most useful GCC options and extensions
#10A few others I use are -Wsign-compare and -Wformat-nonliteral. Sign compare warns on possible bugs/vulnerabilities due to comparing signed and unsigned values. Using nonliteral formats can lead to vulnerabilities (such as the famous attacks on FTP servers http://seclists.org/bugtraq/1999/Sep/328 )