compiler-warnings

Why am I am getting the warning “Multiple methods named 'center' found”

隐身守侯 提交于 2019-12-12 04:14:05
问题 I only get this warning if I import my helper class (#import "JLHelper.h"). An example of the where the warning occurs... [[subViews objectAtIndex:i] center].y+translation.y)]; I understand that it is telling me that the compiler sees more than one method named center, but center is declared in the framework in CLRegion.h. Why would the compiler see more than one method in this case? Is it a problem to be concerned about, and if so how do I track down and resolve it. Thanks, John Problem

Building project under VS2013 works only when each *.cpp's are compiled manually

点点圈 提交于 2019-12-12 03:59:09
问题 I'm trying to compile Ogre Wiki Tutorial Framework 1.9 - (Windows line endings) in VisualStudio 2013. Right click on OgreFramework project and choosing Rebuild returns following errors: Error 487 error LNK2001: unresolved external symbol "protected: virtual void __thiscall BaseApplication::windowClosed(class Ogre::RenderWindow *)" (?windowClosed@BaseApplication@@MAEXPAVRenderWindow@Ogre@@@Z) c:\Users\wakatana\Documents\Visual Studio 2013\Projects\OgreFramework\OgreFramework

Eclipse warn about uncaught Error

五迷三道 提交于 2019-12-12 03:36:53
问题 When failing to catch a subclass of Exception , Eclipse will issue a compilation warning (red). However, when an subclass of Error is uncaught, no warning is issued, making it easy to forget including the throws SomethingError statement. 回答1: This is the difference between checked (subclasses of Exception excluding RuntimeException) and unchecked exceptions (subclasses of RuntimeException or Error). Oracle note on the subject Stackoverflow: Java: checked vs unchecked exception explaination

All warnings as errors with the Eclipse Java compiler (3.6.2)

倖福魔咒の 提交于 2019-12-12 03:34:45
问题 How do I treat warnings as errors with the Eclipse Java compiler (ECJ) 3.6.2 * when running from the command-line ? Newer versions (at least, 3.8.2) have the -err:all flag, however this isn't available in 3.6.2. Do I have any other options? I've found this question ( Javac: Treat warnings as errors ) which recommends the undocumented -Werror flag, but that only seems to work for javac. Note: For various reasons completely out of my control, I must use ECJ 3.6.2. So switching to a newer

Warning when comparing references to int and unsigned but no warning if comparing consts (no ref) with g++/msvc

杀马特。学长 韩版系。学妹 提交于 2019-12-12 03:18:41
问题 So I'm writing the doctest library and it's supposed to be warning free. I recently noticed that code that went into an if statement without warnings was causing trouble when written inside of my CHECK() macro. For example: if(0u == 0) doesn't cause a warning but CHECK(0u == 0); does. I investigated a bit and part of the reason is that behind the CHECK() macro there are templates and expression decomposition and capturing by const reference. My questions are 3: Given these 3 snippets - why

Multiple Definitions of Same #define Macro in Required Libraries

◇◆丶佛笑我妖孽 提交于 2019-12-12 03:15:58
问题 Two of the libraries I am including share the same definition of a macro in each of their respective .h files. #define MAX <some value> //first definition of MAX in a file #define MAX <some other value> //second definition of MAX in a *different* file and in compilation I get .../httpd.h:43:1: warning: "MAX" redefined and .../opencv2/core/types_c.h:272:1: warning: this is the location of the previous definition I've checked each of these headers, and they have the #include guards. What is the

im getting a warning using objectFromJSONData

妖精的绣舞 提交于 2019-12-12 03:09:57
问题 my objective C app compiles successfully, but i get an Xcode warning: Instance method '-objectFromJSONData' not found (return type defaults to 'id') on this line: NSDictionary *userInfo = [data objectFromJSONData]; How can i get rid of that warning? 回答1: When you make a custom class or use a class built outside of apple, you need to import the headers for the framework or class you are using. This allows the compiler to cross check return types and so forth. When you attempt to send valid

C# warning: “The variable is assigned but its value is never used”

允我心安 提交于 2019-12-12 01:39:01
问题 I am a first-timer learning C# and I just started writing my first program. I am currently running into a snag in one of my while loops. Normally I find that outside the loop my variables work like they should, but for some reason Visual Studio is giving me a warning saying that "The variable 'itemPrice' is assigned but its value is never used." How I can I get that warning to go away and avoid any kind of bad practices? using System; class Program { public static void Main() { // "whoa" <--

iPhone SDK warning: class MyAppViewController does not implement the 'UITabbarDelegate' protocol

二次信任 提交于 2019-12-12 01:18:24
问题 Im working on an iPhone app, not using IB, and programmatically created a UITabbar with three items in a UIViewController in a view based application, I used one delegate method, that wont work without the last line in the snippet below( setDelegate method). I dont have a tabbarviewcontroller. UITabBar *tabbar = [[UITabBar alloc] initWithFrame:CGRectMake(0, YMAX-60, XMAX, 40)]; NSMutableArray *items = [[NSMutableArray alloc] initWithCapacity:3]; [items addObject:[[[UITabBarItem alloc]

Is this warning alright - “#368-D: <entity> defines no constructor to initialize the following:”?

一曲冷凌霜 提交于 2019-12-11 23:21:07
问题 In my C++ code, I have a const array of objects of a struct type. This structure has some const members. My hardware compiler (GHS Multi2000) throw the warning: warning#368-D: class defines no constructor to initialize the following: Is this warning alright? I read online that this can be ignored. It is simply that the compiler expects const members to be initialized in the constructor initialization list. Can this warning be suppressed? 回答1: The warning is all right, and meaningful. What