warnings

Disable all gcc warnings

I'm working on a project that will read compiler error messages of a particular variety and do useful things with them. The sample codebase I'm testing this on (a random open-source application), and hence rebuilding frequently, contains a few bits that generate warnings, which are of no interest to me. How do I disable all warnings fro...

How to make this PHP snippet work without warning?

The code is short,but complete: function process($obj) { if(empty($obj))return 1; return 2; } echo process($arr['nosuchkey']); As we all know, calling empty($arr['nosuchkey']) will never report warnings. But process($arr['nosuchkey']) will report a notice. Is there a workaround without disabling warnings; say, by syntax? ...

initwithint warning, no method found?

I have a warning and just can't work out how to make it go away. In my .h I have this... -(void)restartTimer; Then the in my .m I have... -(void)restartTimer{ TimerViewController *TimerView = [[TimerViewController alloc] initWithInt:hStart number:mStart]; I get this error: Warning: no '-initWithInt:number.' method found. I a...

mysql now() Incorrect datetime value for column - error code 1292

When doing simple maths using now() ... mysql> select cdrstatuschangets from cdrs where ( cdrstatuschangets < now() - 10 ); +---------------------+ | cdrstatuschangets | +---------------------+ | 2009-09-25 13:55:50 | +---------------------+ 1 row in set (0.00 sec) show warnings; Empty set (0.00 s...

How to specify type for bulk list assignments

I have the following code that looks like this [a,b,c,d] = ["a","b","c","d"] The compiler reports the warning: Warning: Definition but no type signature for 'a' Inferred type: a :: [Char] How to silence the warning and specify the type for this expression? ...

How to disable warning in xcode on specific line ?

I've got a call like this [Class method] and a warning saying that Class may not respond to "method" message. The "method" message does not indeed exist but my code use unknown message catching (using forwardingTargetForSelector) so it will run fine and it is build to run that way. How can I hide this annoying warning ? ...

How to disable runtime warnings in java?

I am using a jar file in a java program and it generates warnings during runtime. But I don't want that my customer sees these warnings. How can I disable these warnings. The warning is as below: Sep 25, 2009 10:10:33 PM com.gargoylesoftware.htmlunit.IncorrectnessListenerImpl notify WARNING: Expected content type of 'application/javasc...

C# could not load file or assembly...system cannot find file specified

Writing a routine WinForms app that references a few custom libraries written by myself. I am building one particular library which depends on another library and, when I do, I get the following warning message: "Could not load file or assembly 'RHLib' Version 1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. T...

How to get rid of the warning with time.h in C++?

When I use this #include<time.h> //... int n = time(0); //... I get a warning about converting time to int. Is there a way to remove this warning? ...

How do I best silence a warning about unused variables?

I have a cross platform application and in a few of my functions not all the values passed to functions are utilised. Hence I get a warning from GCC telling me that there are unused variables. What would be the best way of coding around the warning? An #ifdef around the function? #ifdef _MSC_VER void ProcessOps::sendToExternalApp(QS...

Disable Flex CSS type selector warning?

I'm building a somewhat large Flex project that includes several modules (a single Flex project that produces multiple SWFs) Right now, I have a single css file, being loaded in the main SWF tag: <s:Application ... > <fx:Style source="css/main.css" /> ... </s:Application> In the CSS file: /* CSS file */ @namespace s "library://n...

XCode warning : Initialization makes pointer from integer without a cast (while trying to assign a value to a NSNumber)

Hi all, I'm stuck with a warning in Xcode while trying to develop a small iPhone App. I've got this piece of code in Xcode : NSNumber *randomNumber = arc4random() % [array count]; If I NSLog randomNumber, everything seems to work but Xcode keeps warning me, saying : Initialization makes pointer from integer without a cast There must...

How to catch and display warnings to the user.

Essentially the warning in our case is just a validation, we don't want to mark it as an error just a warning so the user knows. I was hoping to use the same or similar method used for validation. Currently I'm leaning towards implementing IDataErrorInfo. But I'd like to change the style on display and allow saving. Has anyone done a...

Why do I get encoding error in python warnings.formatwarning on format string?

I get encoding error on this line: s = "%s:%s: %s: %s\n" % (filename, lineno, category.__name__, message) UnicodeEncodeError: 'ascii' codec can't encode character u'\xc4' in position 44: ordinal not in range(128) I tried to reproduce this error by passing all combinations of parameters to string format, but closest I got was "ascii ...

What does a PHP warning mean if it refers to something that happened on "Line 0"?

I've not come across an error like this before where Line 0 is referred to. Does it have a specific meaning, or is it simply that PHP was unable to determine the line number before something went wrong? The full warning is: Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /xxxxxx/text_editor.php o...

Custom Compiler Warnings in Visual Studio 2008

http://stackoverflow.com/questions/154109/custom-compiler-warnings and http://stackoverflow.com/questions/968249/c-create-custom-warning-in-visual-studio-if-certain-method-is-used-in-source-co haven't helped as they deal with code that is under the author's control. We are using a 3rd party suite of UI controls (DevExpress) in our softw...

gcc warning" 'will be initialized after'

I am getting a lot of these warnings from 3rd party code that I cannot modify. Is there a way to disable this warning or at least disable it for certain areas (like #pragma push/pop in VC++)? Example: list.h:1122: warning: `list<LogOutput*, allocator<LogOutput*> >::node_alloc_' will be initialized after list.h:1117: warning: `alloca...

How to define (non-method) functions in header libraries

When writing a header library (like Boost), can one define free-floating (non-method) functions without (1) bloating the generated binary and (2) incurring "unused" warnings? When I define a function in a header that's included by multiple source files which in turn is linked into the same binary, the linker complains about redefinition...

Can I get warnings for sending nil objects messages?

I'm aware that it's perfectly fine to send messages to nil objects in Objective-C. However, I am curious if there is any runtime support for flagging such situations. I can see this being useful in testing/debugging situations. ...

Decipher UIViewController property warning

I cant understand what this warning I get on Xcode is about. Searching for it on google wasn't of too much help. If anyone has come across this warning before, it'd be great if I could get some hints on how I'd be able to get rid of it. The (updated) screenshot is at: http://imagebin.antiyes.com/images/0116033001255720169%5F90.png Tha...