compiler-warnings

C# Bitwise-or operator used on a sign-extended operand; consider casting to a smaller unsigned type first

时间秒杀一切 提交于 2019-12-03 22:35:00
I know these warnings are probably pointless.. But anyway I could get rid of them? I got 7 of these warnings. Bitwise-or operator used on a sign-extended operand; consider casting to a smaller unsigned type first This has something to do with the OR operator | I highlighted what gives off the warnings. int result = (int)ror((uint)(v76 ^ (v75 | 0x862D63D3)), (uint)(BitConverter.ToInt32(v4, 72) ^ 0x22)); int v11 = (int)rol((uint)(int)((v8 & v10 | ~v10 & 0xEFCDAAC9) + v3[2] - 1126481991), 17); int v144 = (int)rol((uint)(int)((v141 & v143 | ~v143 & 0xEFCDAAC9) + v3[2] - 1126481991), 17); int v77 =

Const correctness warnings c++

末鹿安然 提交于 2019-12-03 22:21:58
Does anyone know of any warnings that C++ compilers provide that help to enforce const correctness? For instance, it would be nice to have a warning produced by any C++ method that contains a non-const parameter that is never modified inside of the method. I see that there is a gnu compiler warning called -Wsuggest-attribute=const; however, when I use this flag I get an error saying that it is not recognized. Any ideas why? I don't think such a warning exists, mostly because it would be useless. Just because a parameter is not modified inside the call, doesn't mean it should be made const just

bootstrap class path not set

好久不见. 提交于 2019-12-03 22:12:32
So I am getting- warning: [options] bootstrap class path not set in conjunction with -source 1.6 And I am about to ask 3 questions about it. I understand that I need to set the bootstrap class path but I am not sure I understand how. A quick google just sent me to pages that quoted from the Oracle page, but I read the Oracle page and didn't feel that I understood it particularly well. I am currently running this code on Netbeans, so all I have to do is hit the play button for it to compile and run. Is there a property that dictates how this will compile so that I may add in the bootstrap class

Why is GCC tricked into allowing undefined behavior simply by putting it in a loop?

不问归期 提交于 2019-12-03 22:10:08
The following is nonsensical yet compiles cleanly with g++ -Wall -Wextra -Werror -Winit-self (I tested GCC 4.7.2 and 4.9.0): #include <iostream> #include <string> int main() { for (int ii = 0; ii < 1; ++ii) { const std::string& str = str; // !! std::cout << str << std::endl; } } The line marked !! results in undefined behavior, yet is not diagnosed by GCC. However, commenting out the for line makes GCC complain: error: ‘str’ is used uninitialized in this function [-Werror=uninitialized] I would like to know: why is GCC so easily fooled here? When the code is not in a loop, GCC knows that it is

Disable ARC with Xcode 5

佐手、 提交于 2019-12-03 22:02:42
问题 In versions of Xcode previous to 5, we can disable ARC in the project settings when we create the project. Now ARC is causing this problem for me. With an property list file, for the reading step, the compiler gives me an error: "implicit conversion of 'int' to 'id' is disallowed with ARC". I did not have this problem with the same code with Xcode 4. In my property list file, The keys are numbers and also in my viewController.m When I disallow ARC for the target, the warning persists. I don't

MSB3270: Mismatch between the processor architecture - Fakes Framework

可紊 提交于 2019-12-03 19:07:00
问题 Since I use Fakes Framework in my UnitTest, I get the following MSBuild warning. warning MSB3270: There was a mismatch between the processor architecture of the project being built "MSIL" and the processor architecture of the reference "DocumentServiceModel", "x86". This mismatch may cause runtime failures. Please consider changing the targeted processor architecture of your project through the Configuration Manager so as to align the processor architectures between your project and

How to suppress warnings in Xcode?

妖精的绣舞 提交于 2019-12-03 16:39:36
In Xcode 5, is there any way to suppress warnings such as unused variables for number of files? Particularly latest Box2D 2.2.1 produces some warnings which are annoying but harmless. Select the project in the navigator, then select the target from the list. Select the Build Phases tab, then expand the Compile Sources phase. The Compiler Flags column is where you specify per-file compiler flags. Enter -Wno- to negate a warning. e.g.: -Wno-unused-parameter You can add a compiler flag -w for each affected .m file you want silenced, in the build phases for your app's target, under "Compile

Visual Studio 2010 (C++): suppress C4706 warning temporarily

╄→尐↘猪︶ㄣ 提交于 2019-12-03 11:22:33
When you compile the following C++ source file in Visual Studio 2010 with warning level /W4 enabled #include <cstdio> // for printf #include <cstring> // for strcmp char str0[] = "Hello"; char str1[] = "World"; int main() { int result; if (result = strcmp(str0, str1)) // line 11 { printf("Strings are different\n"); } } you get the following warning warning C4706: assignment within conditional expression for line 11. I want to suppress this warning exactly at this place. So I tried Google and found this page: http://msdn.microsoft.com/en-us/library/2c8f766e(v=VS.100).aspx So I changed the code

VS2010: Autogenerated files and XML documentation

早过忘川 提交于 2019-12-03 11:11:12
问题 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 contains a number of autogenerated files (using mgmtclassgen.exe). When I generate the XML documentation, my beautifully commented library is plagued by xml documentation

Turn off warnings coming from subprojects

别来无恙 提交于 2019-12-03 10:53:48
问题 Can someone help me to turn off warnings in Xcode 4 that I'm getting from subprojects? I have three subprojects, with a lot of warnings. The subprojects are provide by my customer's R&D studio. I would like to turn off the warnings there, to put all my efforts and attention on warnings in my own code. Is this possibile in Xcode 4? 回答1: If you're using Xcode 4.2 or later, you can use LLVM compiler setting Inhibit All Warnings in Warning Polices for every subproject you have: 回答2: A partial