By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,230 Members | 2,436 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,230 IT Pros & Developers. It's quick & easy.

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

P: n/a
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
Jul 22 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
"Maciej Pilichowski" <ba***@SKASUJTOpoczta.FM> 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
Jul 22 '05 #2

P: n/a
* Victor Bazarov:
"Maciej Pilichowski" <ba***@SKASUJTOpoczta.FM> 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?
Jul 22 '05 #3

P: n/a

"Maciej Pilichowski" <ba***@SKASUJTOpoczta.FM> wrote in message news:a9********************************@4ax.com...
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.
Jul 22 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.