compiler-warnings

Bad path warning, where is it coming from?

China☆狼群 提交于 2019-12-03 07:40:08
问题 When I compile my project with compiler warnings (JDK 1.5) I get a bunch of bad path element warnings: Warning:: [path] bad path element "C:\Users\User\MyJava\common\lib\junit.jar": no such file or directory Warning:: [path] bad path element "C:\Users\User\MyJava\common\lib\jdom.jar": no such file or directory Warning:: [path] bad path element "C:\Users\User\MyJava\common\lib\xerces.jar": no such file or directory Warning:: [path] bad path element "C:\Users\User\MyJava\common\lib\xml-apis.jar

Any way to generate warnings for function-pointer comparisons?

只愿长相守 提交于 2019-12-03 06:37:57
问题 It took me forever to track down that there was a bug in my code being triggered by /OPT:ICF : Because /OPT:ICF can cause the same address to be assigned to different functions or read-only data members (const variables compiled by using /Gy), it can break a program that depends on unique addresses for functions or read-only data members. (I had been storing and comparing function pointers for equality, which breaks when the linker throws away identical functions.) Now I need to find every

Making GCC and Other C++ Compilers Very Strict

删除回忆录丶 提交于 2019-12-03 05:51:17
问题 I'm working on a large collaborative C++ project that is both developed and run on various flavors of Linux, OS X and Windows. We compile across these platforms with GCC, Visual Studio C++ and the Intel C++ compiler. As more and more people start developing code for the project, we're starting to see weird errors in compilation and runtime that are specific to particular compilers on particular operating systems. An example of this is implicit inclusion of headers that certain OS/compiler

gcc: How to use __attribute((__may_alias__)) properly to avoid “derefencing type-punned pointer” warning

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-03 05:06:50
I've got some code that uses type-punning to avoid having to call a member "object"'s constructor and destructor unless/until it's actually necessary to use the object. It works fine, but under g++ 4.4.3, I get this dreaded compiler warning: jaf@jeremy-desktop:~$ g++ -O3 -Wall puns.cpp puns.cpp: In instantiation of ‘Lightweight<Heavyweight>’: puns.cpp:68: instantiated from here puns.cpp:12: warning: ignoring attributes applied to ‘Heavyweight’ after definition puns.cpp: In destructor ‘Lightweight<T>::~Lightweight() [with T = Heavyweight]’: puns.cpp:68: instantiated from here puns.cpp:20:

Disable GCC “may be used uninitialized” on a particular variable

ε祈祈猫儿з 提交于 2019-12-03 04:46:24
问题 I'm getting this warning on a stack variable: warning: object.member may be used uninitialized in this function In this case I do not wish to force initialization to just to get rid of the warning as it consumes CPU cycles. The variable is a POD structure so a memset on it is not zero cost. I can verify that the variable is never used uninitialized, so I'd just like to suppress the warning for it. In general I do want the warning, just not on this particular variable in this particular

How to get warnings of incorrect string formatting (C++)

帅比萌擦擦* 提交于 2019-12-03 02:01:07
apologies in advance if i use poor terminology. when i compile a C++ app under gdb and use printf() it gives me awesome warnings relating to the consistency of the format string and the arguments passed in. eg, this code: printf("%s %s", "foo"); results in a compiler warning "too few arguments for format", which is super-useful. it will also give warnings about format string type vs. argument type. it must have inspected the format string and compared that against the supplied argument types. - is this sort of compile-time introspection something which can be added to ordinary source code, or

Turn off warnings coming from subprojects

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-03 01:22:32
Can someone help me to turn off warnings in Xcode 4 that I'm getting from subprojects? I have three subprojects, with a lot of warnings. The subprojects are provide by my customer's R&D studio. I would like to turn off the warnings there, to put all my efforts and attention on warnings in my own code. Is this possibile in Xcode 4? If you're using Xcode 4.2 or later, you can use LLVM compiler setting Inhibit All Warnings in Warning Polices for every subproject you have: A partial solution only: If your subprojects build libraries or bundles that do not have to recompile at every run, you can

Is there a DCC32 option to treat a specific compiler warning as an error?

岁酱吖の 提交于 2019-12-02 22:30:43
For command-line builds, I would like to treat warnings (for example "Constructing instance containing abstract method") as errors. I have not found a dcc32 command line option for this purpose in Delphi 2009. Is there a way, for example using dcc32.cfg, to do this? David Heffernan Like this: dcc32 -W^^CONSTRUCTING_ABSTRACT MyProject.dpr For example, with this program: program MyProject; type TMyClass = class procedure X; virtual; abstract; end; begin TMyClass.Create; end. And here's the output: >dcc32 MyProject.dpr Embarcadero Delphi for Win32 compiler version 24.0 Copyright (c) 1983,2012

Bad path warning, where is it coming from?

巧了我就是萌 提交于 2019-12-02 21:17:26
When I compile my project with compiler warnings (JDK 1.5) I get a bunch of bad path element warnings: Warning:: [path] bad path element "C:\Users\User\MyJava\common\lib\junit.jar": no such file or directory Warning:: [path] bad path element "C:\Users\User\MyJava\common\lib\jdom.jar": no such file or directory Warning:: [path] bad path element "C:\Users\User\MyJava\common\lib\xerces.jar": no such file or directory Warning:: [path] bad path element "C:\Users\User\MyJava\common\lib\xml-apis.jar": no such file or directory and many more. This is using IDEA 8.1.3. I can't find anywhere in IDEA's

Making GCC and Other C++ Compilers Very Strict

ⅰ亾dé卋堺 提交于 2019-12-02 20:34:04
I'm working on a large collaborative C++ project that is both developed and run on various flavors of Linux, OS X and Windows. We compile across these platforms with GCC, Visual Studio C++ and the Intel C++ compiler. As more and more people start developing code for the project, we're starting to see weird errors in compilation and runtime that are specific to particular compilers on particular operating systems. An example of this is implicit inclusion of headers that certain OS/compiler pairs seem to find for you, accidentally overloading a function from a base class in a derived class. My