473,320 Members | 2,147 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

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

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
3 2670
"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
* 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

"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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Ape Ricket | last post by:
Hi. During my program's set-up phase where it reads in the arguments it was invoked with, I programmed this: if (strcmp(argv,"-G") ==0) { geom_scaling = ON; if (i < argc-1)...
43
by: Anitha | last post by:
Hi I observed something while coding the other day: if I declare a character array as char s, and try to use it as any other character array..it works perfectly fine most of the times. It...
4
by: bingfeng | last post by:
I have some codes generated by perl, in which initialize some huge struct,such as PARA TOS_network_spantree_set_0_para_0 = { "vlan", emNUM, NULL, "", "configuration on a designated vlan",...
6
by: Johs32 | last post by:
I get this warning: warning: incompatible implicit declaration of built-in function 'printf' because I use printf in a function that I include in a .h file that is included by other files...Do...
1
by: TC | last post by:
Every time I open my project, I get a warning which says "There are updated custom wrappers available for the following referenced components: Office." When I double-click on the warning, I get...
2
by: Hendrik Schober | last post by:
Hi, this piece of code namespace { template< typename T > struct X {}; template< typename T > struct Y {};
92
by: Heinrich Pumpernickel | last post by:
what does this warning mean ? #include <stdio.h> int main() { long l = 100; printf("l is %li\n", l * 10L);
2
by: mattmao | last post by:
My code works fine with this command: gcc mycode.c It is compiled and runs just as I wanted. But since my assignment has a specific restriction, my code must go through this: gcc...
3
by: rorni | last post by:
Hi, I'm porting code from Windows to HP-UX 11, compiling with g++. I'm getting a compilation error on the system's debug.h include file, which is included very indirectly through a series of...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.