Berkeley CSUA MOTD:Entry 33894
Berkeley CSUA MOTD
 
WIKI | FAQ | Tech FAQ
http://csua.com/feed/
2025/05/25 [General] UID:1000 Activity:popular
5/25    

2004/10/3-4 [Computer/SW/Compilers] UID:33894 Activity:nil
10/2    Is there a way to disable specific warnings in gcc?
        \_ Use the source, Luke!
        \_ Even easier than source, use the manual, info gcc.
           \_ I did.  It doesn't help.  It describes command-line options to
              disable a few specific warnings, but it doesn't describe any
              general mechanism.  I guess what I'm looking for is something
              like MSVC's #pragma warning(disable:xxxx)
              \_ from the man page,
                      -w  Inhibit all warning messages.
                 \_ Read the whole thread.  It's not that long.  I'm looking
                    for a general mechanism to disable *specific* warnings
                    (and preferably in a specific file, or better yet, in a
                    specific section of code).  I don't want to disable all
                    warnings.  That'd be retarded.
                    \_ It's more retarded to just ignore some warnings in
                       a single file.  If it's a single file, FIX it.
                       Apologies if this sounds harsh; I'm actually
                       yelling at most of my coworkers.  Btw, which
                       warning?  Why is it unfixable?
        \_ gcc foo.c |& grep -v unwanted_warnings