warnings

What is the meaning of the type safety warning in certain Java generics casts?

What is the meaning of the Java warning "Type safety: The cast from Object to List is actually checking against the erased type List"? I get it when I try to cast an Object to a type with generic information, such as in the following code: Object object = getMyList();List<Integer> list = (List<Integer>) object;...

Boost warnings with VC++ 9

When the Boost library/headers is used with VC++ 9 compilers (Visual C++ 2008 Express Edition or Visual Studio 2008), a lot of benign warnings are generated. They are of 2 kinds: Warning about the Wp64 setting. Warning about the compiler version. How can I turn off these warnings? ...

Warning: Found conflicts between different versions of the same dependent assembly

I am currently developing a .NET application, which consists of 20 projects. Some of those projects are compiled using .NET 3.5, some others are still .NET 2.0 projects (so far no problem). The problem is that if I include an external component I always get the following warning: "Found conflicts between different versions of the same ...

Can I detect and handle MySQL Warnings with PHP?

I'm dealing with a MySQL table that defines the JobName column as UNIQUE. If somebody tries to save a new Job to the database using a JobName that is already in the database, MySQL throws a warning. I would like to be able to detect this warning, just like an error, in my PHP script and deal with it appropriately. Ideally I would like...

How to get rid of `deprecated conversion from string constant to ‘char*’` warnings in GCC?

So I'm working on an exceedingly large codebase, and recently upgraded to gcc 4.3, which now triggers this warning: warning: deprecated conversion from string constant to ‘char*’ Obviously, the correct way to fix this is to find every declaration like char *s = "constant string"; or function call like void foo(char *s); foo...

How to disable a warning in Delphi about "return value ... might be undefined"?

I have a function that gives me the following warning: [DCC Warning] filename.pas(6939): W1035 Return value of function 'function' might be undefined The function, however, is clean, small, and does have a known, expected, return value. The first statement in the function is: Result := ''; and there is no local variable or parameter...

"No newline at end of file" compiler warning

What's the reason for the "No newline at end of file" warning in some C++ compilers? What's good about having an empty line at the end of a source\header file? ...

Perl: Use of uninitialized value in numeric lt (<) at /Date/Manip.pm

This has me puzzled. This code worked on another server, but it's failing on Perl v5.8.8 with Date::Manip loaded from CPAN today. Warning: Use of uninitialized value in numeric lt (<) at /home/downside/lib/Date/Manip.pm line 3327. at dailyupdate.pl line 13 main::__ANON__('Use of uninitialized value in numeric lt (<) at /home/dow...

How can you get Perl to stop when referencing an undef value?

How do you get Perl to stop and give a stack trace when you reference an undef value, rather than merely warning? It seems that use strict; isn't sufficient for this purpose. ...

Which gcc switch disables "left-hand operand of comma has no effect" warning?

It's a part of larger code base, which forces -Werror on gcc. This warning is generated in a third party code that shouldn't be changed (and I actually know how to fix it), but I can disable specific warnings. This time man gcc failed me, so please, let some gcc master enlighten me. TIA. ...

MFC "Warning: skipping non-radio button in group."

When running an old MFC application in Visual Studio's debugger I've seen a lot of warnings in the Output window like the following: Warning: skipping non-radio button in group. I understand that in MFC you put radio buttons in groups to indicate which sets of radio buttons go together. If I remember correctly you do this by setti...

How to disable #pragma warnings?

While developing a C++ application, I had to use a 3rd party library which produced a huge amount of warnings related with a harmless #pragma directive being used. ../File.hpp:1: warning: ignoring #pragma ident In file included from ../File2.hpp:47, from ../File3.hpp:57, from File4.h:49, Is it possibl...

Why is "The referenced component 'X' could not be found." considered a warning?

I wonder, why the hell... did the VS team consider that NOT finding a project reference as a non crucial thing? The referenced component 'X' could not be found. should be considered an error... and nothing else. Is there a way (without turning 'Treat all warnings as errors' on) to get this warning as an error in VS2008? ...

Portability of #warning preprocessor directive

I know that the #warning directive is not standard C/C++, but several compilers support it, including gcc/g++. But for those that don't support it, will they silently ignore it or will it result in a compile failure? In other words, can I safely use it in my project without breaking the build for compilers that don't support it? ...

Suppressing warnings for JDK1.4 project

Is it possible to suppress warnings in Eclipse for JDK1.4 project? EDIT: Longer version. There is a project which requires JDK1.4 (no annotations). Only way of suppressing warnings I know is using annotation @SuppressWarnings - no can do in JDK1.4. Is there any way to remove some warning notifications in some specific method/class (not ...

How can I suppress individual BizTalk warnings in Visual Studio 2005

We are currently using BizTalk 2006 R2 to build Enterprise Integration solutions. We use BizTalk maps extensively, but when you build a solution in Visual Studio 2005, it produces the following warning against maps: Warning Double-click here to show/hide compiler links. In my opinion, these are not real warnings and can be ignored, bu...

C / C++ compiler warnings: do you clean up all your code to remove them or leave them in?

I've worked on many projects where I've been given code by others to update. More often than not I compile it and get about 1,000+ compiler warnings. When I see compiler warnings they make me feel dirty, so my first task is to clean up the code and remove them all. Typically I find about a dozen problems like uninitialized variables such...

How can I get Perl to give a warning message when a certain package/tag is imported?

I have a package that I just made and I have an "old-mode" that basically makes it work like it worked before: importing everything into the current namespace. One of the nice things about having this as a package is that we no longer have to do that. Anyway, what I would like to do is have it so that whenever anyone does: use Foo qw(...

What causes javac to issue the "uses unchecked or unsafe operations" warning

For example: javac Foo.java Note: Foo.java uses unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details. ...

Dealing with C++ "initialized but not referenced" warning for destruction of scope helpers?

In Visual Studio, I often use objects only for RAII purposes. For example: ScopeGuard close_guard = MakeGuard( &close_file, file ); The whole purpose of *close_guard* is to make sure that the file will be close on function exit, it is not used anywhere else. However, Visual Studio gives me a warning that a "local variable is initial...