473,757 Members | 10,736 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2688
"Maciej Pilichowski" <ba***@SKASUJTO poczta.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***@SKASUJTO poczta.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***@SKASUJTO poczta.FM> wrote in message news:a9******** *************** *********@4ax.c om...
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
7778
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) strcpy(geom_string,argv); }
43
2737
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 holds strings of any length. I guess what is happening here is that this array initially holds only '\0' and hence is of length 1. But sometimes, when I tried to write some functions and do some
4
4119
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", PRO_REQUIRED }; const char* TOS_network_spantree_set_0_para_1_emvalue = { "disable", "enable", NULL }; PARA TOS_network_spantree_set_0_para_1 = { "", emENUM, TOS_network_spantree_set_0_para_1_emvalue, "", "enable or disable STP", PRO_REQUIRED };
6
119583
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 I need to remove the printf call?
1
6883
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 a dialog box which says "One or more custom wrappers for COM components have been installed on your machine after you added references to those COM components. These wrappers may provide additional capabilities not offered by the auto-generated...
2
3877
by: Hendrik Schober | last post by:
Hi, this piece of code namespace { template< typename T > struct X {}; template< typename T > struct Y {};
92
6242
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
1841
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 -pedantic-errors Wmissing-declarations -Wall -Werror -ansi mycode.c Well, then it responds with a warning message: gcc:Wmissing-declarations:No such file or directory.
3
3271
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 other system include files. The one I am including is <map> . The errors I am getting are: /opt/hp-gcc-4.2.1/lib/gcc/ia64-hp-hpux11.23/4.2.1/../../../../include/c++/4.2.1/debug/debug.h: At global scope:...
0
9489
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
1
9885
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9737
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8737
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7286
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6562
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5329
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3829
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2698
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.