warnings

Suppress warning on solution level. Treat warning as error on solution level

て烟熏妆下的殇ゞ 提交于 2019-12-23 08:07:32
问题 I am trying to set global rules for my team. We are using VS2012 with TFS for our C# projects. I'd like to suppress some of the warnings and also treat some of the warnings as errors. I found the way to do it on the project level - project properties -> build tab. But we have solution with more than hundred projects and I am looking for some easier way to set those rules globally. 回答1: A solution is just a (pretty dumb) container for projects. If you open it in a text editor you'll quickly

Custom view is missing constructor used by tools for adapter

风格不统一 提交于 2019-12-23 08:00:17
问题 I got the following warning: Custom view com/example/view/adapter/SomeAdapter is missing constructor used by tools: (Context) or (Context,AttributeSet) or (Context,AttributeSet,int) in my class SomeAdapter which extends some BaseAdapter which extends ArrayAdapter public class SomeAdapter extends BaseAdapter{} public abstract class BaseAdapter extends ArrayAdapter<SomeModel>{} The warning exists in the concrete adapter but not in the abstract BaseAdapter. Has anyone ever heard of this warning

how-to add “warnings as error” rule to Qt .pro file?

两盒软妹~` 提交于 2019-12-23 07:07:51
问题 When I usually work on a C++ project, one of the first things I do is setting up the "treat warning as errors" on my compiler. When using Qt , qmake generates the Makefile for you and doesn't include this option on the compilation commands. I'm pretty sure there is a way to add such an option (and others) into the generated Makefile but I couldn't figure it out. How would I do that ? I'm using the open-source version of Qt with g++ as the compiler. 回答1: You can use QMAKE_CXXFLAGS in pro file

Macro redefinition warnings

随声附和 提交于 2019-12-23 04:42:40
问题 I am migrating a windows driver project from VS 2005 to VS 2012 . Many macro redefinition warnings are generated on VS 2012 like - .... 1>C:\WINDDK\7600.16385.1\inc\api\sal.h(707): warning C4005: '__format_string' : macro redefinition 1> c:\program files (x86)\microsoft visual studio 11.0\vc\include\sal.h(2860) : see previous definition of '__format_string' ..... It was compiling fine with sal.h shipped with VS 2005 because it doesn't have the macro __format_string and others. However, the

Capturing warning messages

非 Y 不嫁゛ 提交于 2019-12-23 04:14:13
问题 Is there a way to capture the warnings, something like rescue for exceptions? I do not want to simply disable the warnings (by doing $VERBOSE = nil ) but want to capture the content of the warning messages during run time. 回答1: You can redirect stderr to a StringIO object to capture the warnings output in a string: require 'stringio' old_stderr = $stderr $stderr = StringIO.new Foo = 1 Foo = 2 # generates a warning puts $stderr.string # prints the warning $stderr = old_stderr 回答2: require

Capturing warning messages

让人想犯罪 __ 提交于 2019-12-23 04:14:07
问题 Is there a way to capture the warnings, something like rescue for exceptions? I do not want to simply disable the warnings (by doing $VERBOSE = nil ) but want to capture the content of the warning messages during run time. 回答1: You can redirect stderr to a StringIO object to capture the warnings output in a string: require 'stringio' old_stderr = $stderr $stderr = StringIO.new Foo = 1 Foo = 2 # generates a warning puts $stderr.string # prints the warning $stderr = old_stderr 回答2: require

SDL Help. Xcode. Build and Run Error

穿精又带淫゛_ 提交于 2019-12-23 03:38:14
问题 I have been going off of this tutorial http://www.noquarterarcade.com/xcode-sdl-development-setup So, I have downloaded both the SDL Runtime Library and the SDL Development Library and put their content in the specified folders. I have made sure that have followed these steps correctly. However, when I click build and run I get an error and 2 warning. Error: 1) Command/Developer/usr/bin/gcc-4.2 failed with exit code 1 Warnings: 1) Directory'/Users/RustyShackleford/Library/Frameworks'

warning : Implicit declaration error [duplicate]

冷暖自知 提交于 2019-12-23 02:38:22
问题 This question already has answers here : warning: implicit declaration of function (6 answers) Closed 4 years ago . Here's the files , i want to use includes : primitives.h: #ifndef PRIMITIVES_H_ #define PRIMITIVES_H_ #include "bloc.h" #endif primitives.c #include "primitives.h" Bloc_T creat2(char* ,BT_T); Bloc_T creat2(char* nomfic ,BT_T typefic) { Bloc_T Nouv_Bloc; setTitreMeta(Nouv_Bloc.infosFic,nomfic); Nouv_Bloc.typeBloc= typefic; return Nouv_Bloc; } bloc.h: #ifndef STRUCTURES_H_INCLUDED

C: Illegal conversion between pointer types: pointer to const unsigned char -> pointer to unsigned char

╄→尐↘猪︶ㄣ 提交于 2019-12-22 16:04:29
问题 The following code is producing a warning: const char * mystr = "\r\nHello"; void send_str(char * str); void main(void){ send_str(mystr); } void send_str(char * str){ // send it } The error is: Warning [359] C:\main.c; 5.15 illegal conversion between pointer types pointer to const unsigned char -> pointer to unsigned char How can I change the code to compile without warnings? The send_str() function also needs to be able to accept non-const strings. (I am compiling for the PIC16F77 with the

C: Illegal conversion between pointer types: pointer to const unsigned char -> pointer to unsigned char

自古美人都是妖i 提交于 2019-12-22 16:03:14
问题 The following code is producing a warning: const char * mystr = "\r\nHello"; void send_str(char * str); void main(void){ send_str(mystr); } void send_str(char * str){ // send it } The error is: Warning [359] C:\main.c; 5.15 illegal conversion between pointer types pointer to const unsigned char -> pointer to unsigned char How can I change the code to compile without warnings? The send_str() function also needs to be able to accept non-const strings. (I am compiling for the PIC16F77 with the