How to lower warning level? [header wrappers, GCC]

Discussion in 'C++' started by Maciej Pilichowski, Jan 8, 2005.

  1. Hello there,

    The short version -- how to set warning level just for one specific
    file, or more exactly how to relax warning level for it?

    The long version -- I try to work at maximum warning level
    /including -Werror/ but lately I have to work with QT and this library
    generates a lot of warnings. I have read on
    http://www.artima.com/cppsource/ C++ Coding Standards and tried to do
    something similar -- i.e. write a wrapper for all QT included headers.

    I would be nice if this has actually worked out:

    // my project -- top level of warnings

    #pragma warnings_off
    #include qt_headers
    #pragma warnings_on

    // my project -- top level of warnings

    But I couldn't find anything like this above in GCC. All I found is:

    #pragma GCC system_header

    which should ignore any warnings. Maybe it is QT, maybe it is GCC --
    anyway, it doesn't help -- I have still a lot of warnings from QT.
    So... how to get rid of QT warnings, but maintain top warn-level for
    the rest of the project.

    Thanks in advance for your help.

    have a nice day
    bye bye

    --
    Maciej "MACiAS" Pilichowski http://bantu.fm.interia.pl/

    M A R G O T --> http://www.margot.cad.pl/
    automatyczny t³umacz (wczesna wersja rozwojowa) angielsko-polski
     
    Maciej Pilichowski, Jan 8, 2005
    #1
    1. Advertising

  2. "Maciej Pilichowski" <> wrote...
    > The short version -- how to set warning level just for one specific
    > file, or more exactly how to relax warning level for it?
    > [...]


    There is no such concept in C++ _language_ as "warning level". Please
    post your compiler-specific question to the compiler-dedicated forum.
    In your case I suggest gnu.g++.* hierarchy.

    V
     
    Victor Bazarov, Jan 8, 2005
    #2
    1. Advertising

  3. * Victor Bazarov:
    > "Maciej Pilichowski" <> wrote...
    > > The short version -- how to set warning level just for one specific
    > > file, or more exactly how to relax warning level for it?
    > > [...]

    >
    > There is no such concept in C++ _language_ as "warning level". Please
    > post your compiler-specific question to the compiler-dedicated forum.
    > In your case I suggest gnu.g++.* hierarchy.


    Well, one possible non-tool-specific answer could be to use the PIMPL
    idiom.

    But in code that uses QT things all over that's perhaps not practical.

    Anyway it's work work work when the point of using a library like QT is
    (or should be) to avoid the work work work...

    --
    A: Because it messes up the order in which people normally read text.
    Q: Why is it such a bad thing?
    A: Top-posting.
    Q: What is the most annoying thing on usenet and in e-mail?
     
    Alf P. Steinbach, Jan 8, 2005
    #3
  4. Maciej Pilichowski

    Duane Hebert Guest

    "Maciej Pilichowski" <> wrote in message news:...
    > Hello there,
    >
    > The short version -- how to set warning level just for one specific
    > file, or more exactly how to relax warning level for it?
    >
    > The long version -- I try to work at maximum warning level
    > /including -Werror/ but lately I have to work with QT and this library
    > generates a lot of warnings. I have read on
    > http://www.artima.com/cppsource/ C++ Coding Standards and tried to do
    > something similar -- i.e. write a wrapper for all QT included headers.


    Which version of GCC? Which version of Qt?
    With VC7.1/Qt3.3 at warning level 4, there are
    no Qt warnings. I've ported some of my stuff to
    GCC with no problems.
     
    Duane Hebert, Jan 9, 2005
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. pabbu
    Replies:
    8
    Views:
    735
    Marc Boyer
    Nov 7, 2005
  2. Gunter Schelfhout

    Designing lower level classes.

    Gunter Schelfhout, Jun 29, 2008, in forum: C++
    Replies:
    13
    Views:
    556
    James Kanze
    Jun 30, 2008
  3. Afshar
    Replies:
    0
    Views:
    343
    Afshar
    Oct 8, 2008
  4. mlt
    Replies:
    2
    Views:
    863
    Jean-Marc Bourguet
    Jan 31, 2009
  5. Noah Roberts
    Replies:
    238
    Views:
    3,991
    Ian Collins
    Aug 22, 2009
Loading...

Share This Page