compiler-warnings

Why isn't this function caught by the compiler, and what does it do?

I found in some legacy code I'm dealing with this function (in C++) Vec3d Minimum() { if(this->valid) { return minBB; } else { return NULL; } } where Vec3d is a object that is basically a struct with x,y,z and some operators overloaded (code below). AFAIK, you can't return a 0 for a user define...

Why MSVC generates warning C4127 whan constant is used in "while" - C

For code, while(1) { /* ..... */ } MSVC generates the following warning. warning C4127: conditional expression is constant MSDN page for the warning suggests to use for(;;) instead of while(1). I am wondering what advantage for(;;) is giving and why it warns for the constant usage in while? What flag to use on GCC to get the ...

Is there a way to show ALL the compiler warnings in Visual Studio 2010?

I'm cleaning up a project to get rid of all the warnings, but I can only see the first 100 or so in the Error List pane. This is a problem because we're using Team Server for source control and all the warnings shown are in files that are currently checked out (and therefore I can't modify without making someone else possibly do a lot o...

Shouldn't I get a compiler warning for this? how do I enable it?

let's say i have this public class MyClass { public string myMessage { get; set; } void MyMethod() { string myMessage; } } shouldn't i get an alert about myMessage in MyMethod hiding(?) the myMessage property on the class? i'm not getting anything to this effect when i build. how do i activate this check? ...

How to remove 'ImageList_Read' : inconsistent dll linkage warning ?

When I build my Visual C++ Solution ( 2005), I get the following warnings 1> c:\winddk\7000.0.winmain_win7beta.081212-1400\inc\api\commctrl.h(678) : see previous definition of 'ImageList_Read' 1>e:\xml parse\development\gui\h\wtl4mfc.h(6) : warning C4273: 'ImageList_Write' : inconsistent dll linkage 1> c:\winddk\7000.0.w...

How to supress warnings for one ActionScript file?

I've got an ActionScript 3 source file (.as) that has hundreds of untyped variables. This file works perfectly although it outputs a warning for every untyped variable which gets me ~800 warnings clogging the Error panel in my IDE. Although warnings are helpful in my other source files, I want to suppress warnings for this one .as file...

autotools: Enable compiler warnings

Hi, for an autotools-based C project, I'd like to get some more warnings from the compiler (e.g. at least -Wall in CFLAGS). What is the prefered way to enable compiler flags without breaking anything? Is there a m4 macro that tests if a given compiler flag is understood by the compiler? With such a macro I could do TEST_AND_USE(-Wall -...

Selenium RC compilation warning for C#

When I compile my code in VS 2010 (.NET 4.0), I get the following warning: "Warning 1: The referenced assembly "ThoughtWorks.Selenium.Core" could not be resolved because it has a dependency on "System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" which is not in the currently targeted framework ".NETFramework,V...

How can I disable compiler warnings in Eclipse on a file specific basis?

In my Eclipse project are a handful of generated .java files that I need to use for SQLJ and I can't move to a separate project (due to Administrative Overhead). These files are also regularly regenerated so editing them is unfortunately out. Unfortunately these files generate a few hundred java compiler warnings which drown out the use...

VS2010: Autogenerated files and XML documentation

This is really just re-asking this question asked about Visual Studio 2008. Does VS2010 offer any feature to get rid of the CS1591 compiler warning for auto-generated code? CS1591: Missing XML comment for publicly visible type or member To quote the question for VS2008: This is an annoyance more than a problem. My project contain...

Dealing with deprecated methods in iPhone

How do you deal with deprecated methods in iPhone that require you to use a newer method, not available in older versions? Consider the case of setStatusBarHidden:animated:, which was deprecated in iOS 3.2. The documentation points you to use setStatusBarHidden:withAnimation:, which is only available in iOS 3.2 or later. If I understan...

C++: Pointer assignment warning on strchr()

I get the error assignment makes pointer from integer without a cast on the following code, what does it mean? char * splitter; if(splitter = strchr(key, ':') != NULL && *(splitter + 1) == ' ') ...

How to avoid "unused variable" compiler warnings with conditionally compiled NSLog replacements?

This comes out of my search for a smart variant of NSLog(). One key feature of BetterLog() is that the NSLog() replacement compiles out to nothing for release and distribution builds. The proposed solution (see eg http://stackoverflow.com/questions/300673/is-it-true-that-one-should-not-use-nslog-on-production-code) is define a preprocess...

Eclipse: Different compiler warnings for each developer

I'm working in a small team of two, with SVN for version control and Java/Eclipse. The other guy wants to see compiler warnings of a certain kind ("Unqualified access to instance field."), but I don't. So I'm wondering if it's possible in Eclipse to have a different set of compiler warnings for each developer, while still working on the ...

[C] - warning C4172: returning address of local variable or temporary

I've read a lot of other topics on this site about the same problem knowing it would be common. But I guess I'm dumb and can't figure out the proper way to do it. So, I apologize for yet another one of these questions and I'm hoping someone can give me a simple solution and/or explanation. Here's the entire code: Main.c #define WIN32_...

Getting warning from C math library's pow function

I have the following function in my code: int numberOverflow(int bit_count, int num, int twos) { int min, max; if (twos) { min = (int) -pow(2, bit_count - 1); \\ line 145 max = (int) pow(2, bit_count - 1) - 1; } else { min = 0; max = (int) pow(2, bit_count) - 1; \\ line 149 ...

Applying compiler options to specific files.

I am trying to compile and build a project(s) in visual studio and I started looking into compiling with the /Wall option which gives all warnings. I am wondering iof there is a way to run this only on those files I am interested in, since currently I get a million warnings on files i have no ability or desire to change. ...

VB.NET Using a custom timer in a lambda expression in its own "New" statement - is it okay?

This works, and I can't imagine how it might cause problems, but visual studio gives me an warning and that makes me sad. I'm just wondering if doing something like this might ever cause problems: I have a custom timer that acts like a Wait for some number of milliseconds and then execute a function. It looks like this: Public Class ...

delphi 7 - create a custom warning

hi, I'm using Delphi 7, and I want to create a custom warning message(which will be showed at compilation), so I can warn other programmers on some modifications. I've searched on the internet but i didn't found anything relevant. Other solutions, are welcomed as well, as long other programmers are warned about things I want, when the...

system.exception

hi,while doing debugging i found a blue dotted corner around catch block, while hovering it is showing system.exception...what does it mean and what to do ........... ...