compiler-warnings

warning C6031 return value ignored in macro expansion

穿精又带淫゛_ 提交于 2019-12-11 15:09:58
问题 I'm using following code to format HRESULT to message and write the message to file only if HRESULT is an error. The code compiles and works fine, except that I'm getting following compiler warning: Warning C6031 Return value ignored: 'wcsrchr'. I don't want to disable warning but to resolve it, but I'm not able to figure out how? Here is a minimum compilable code: // compile with: /Wall #include <Windows.h> #include <cwchar> // std::wcsrchr #include <comdef.h> // _com_error #include

Is there a gcc compiler option that help capture formal and actual parameter type mismatch?

三世轮回 提交于 2019-12-11 14:17:14
问题 //file1.c #include <stdio.h> void p(int a) { printf("%d\n",a); } //file2.c extern void p(float x); // external declaration doesn't match definition int main(){ float b; b=3.333f; p(b); } Here the external declaration is wrong in that it is different from the actual function definition. I compile and link the two files with: gcc -Wconversion -Wall -std=c99 file1.c file2.c No warning is raised. Is there any gcc compiler option that can help capture this mismatch during compiling/linking? 回答1:

warning: comparison is always true due to limited range of data type causes crash

有些话、适合烂在心里 提交于 2019-12-11 12:26:30
问题 I have a warning that I am unable to find the cause of. I am following instructional code in a text on Cocoa programming that implements a document based image slide show. This warning causes a while loop to be executed more than the correct number of times which causes the program to crash. The code downloaded from the author's website does not have this problem. I assumed it was a simple matter of a typo in my version but carefully reading both versions of code I was unable to come across

Can't manage to get the Star-Schema DBMS benchmark data generator to run properly

狂风中的少年 提交于 2019-12-11 08:08:12
问题 One of the commonly (?) used DBMS benchmarks is called SSB, the Star-Schema Benchmark. To run it, you need to generate your schema, i.e. your tables with the data in them. Well, there's a generator program you can find in all sorts of places (on github): https://github.com/rxin/ssb-dbgen https://code.google.com/p/gpudb/source/checkout (then under tests/ssb/dbgen or something) https://github.com/electrum/ssb-dbgen/ and possibly elsewhere. I'm not sure those all have exactly the same code, but

VHDL (Xilinx toolchain) I'm being scuppered by “array trimming”

孤街醉人 提交于 2019-12-11 04:24:40
问题 I've got a two-file VHDL project that I'm having beginner's difficulties with. It takes the system clock and use a 30-bit clock divider (of which I'm only using a small number of non-consecutive bits) to drive a primitive serial port module (outgoing TX only) module to spit out 8 bit characters periodically. It seems that during the synthesis process, many of the essential signals are being removed by the optimizer, which I didn't expect. The top level file "Glue.vhd"... library IEEE; use

With what should I replace sun.awt.shell.ShellFolder so I don't get compile warnings?

夙愿已清 提交于 2019-12-11 02:56:54
问题 I have a method using sun.awt.shell.ShellFolder.get("fileChooserComboBoxFolders"); which I want to replace (or suppress the warning if possible). Can I replace it with anything not Sun properietary so it doesn't throw warnings on some possible removals? -- UPDATE: not sure if the code is needed at all. It's in a legacy code and I was asked to remove all compile warnings. The one particular with the ShellFolder goes the following: new Thread { public void run() { ShellFolder.get(

How to identify a warning type in a gcc compile log to disable it?

Deadly 提交于 2019-12-11 02:24:43
问题 I have many warnings when I compile my project under Eclipse CDT Indigo and g++ (Debian 4.9.2-10) 4.9.2. From here, it may be explained by some Eclipse parser bugs, plus possibly some external library bugs. I will upgrade Eclipse of course, but I cannot now. I would like then to suppress these cumbersome warnings. I read the manual here, but still I don't see how to identify which options to set. I have unchecked the -Wall option in Eclipse, but nothing is changed. All Eclipse warnings are

Java Deprecated Class using a Deprecated Class — Can I turn off the compiler warning?

此生再无相见时 提交于 2019-12-11 01:58:47
问题 I am working on deprecating a set of Java classes so they aren't used anymore. I don't want to turn off the compiler warnings for deprecated usage, but I'm finding that if one of my deprecated classes imports another deprecated class I get a warning on that, too. I don't want to modify the code I'm deprecating, but I also don't want the warning for those cases. Is there a way to (a) annotate / comment the code to disable the warning (b) turn off compiler warnings in these cases? I'm using

Eclipse does not detect missing try/catch anymore?

≡放荡痞女 提交于 2019-12-11 01:08:55
问题 In this code String a = "notANumber"; Integer b = Integer.parseInt(a); A try/catch is necessary since parseInt throws an NumberFormatException exception. In my previous version of Eclipse, I used to got a warning telling that a try/catch was necessary but I can't figured out how to enable it on my current version of Eclipse which is Eclipse Java EE IDE for Web Developers. Version: Kepler Service Release 1 回答1: A NumberFormatException is a RuntimeException . You don't have to put try / catch

Obligation to call a method

▼魔方 西西 提交于 2019-12-11 00:25:48
问题 In VB .NET, when you create a user control class, you have the obligation to call the sub InitializeComponent within the constructor. If you don't you'll a warning message like this : 'Public Sub New()' in designer-generated type 'MyUserControl' should call InitializeComponent method. What is the mechanism used to raise this warning? Is it something I can reproduce for my own functions? 回答1: This is built-in behavior for the VB.NET compiler. This sample class triggers it: <Global.Microsoft