suppress-warnings

How to eliminate the “discard qualifier” warning?

独自空忆成欢 提交于 2019-12-30 10:12:29
问题 Using GCC and C99 mode, I have a function declared as: void func(float *X); When I call the function, I use a volatile array Y: volatile float Y[2]; int main() { func(Y); return 0; } When compiling (with -Wall ), I get the following warning: warning: passing argument 1 of ‘func’ discards qualifiers from pointer target type blah.c:4: note: expected ‘float *’ but argument is of type ‘volatile float *’ I can eliminate it with an explicit (float *) type cast, but this repeats in many places in

Can I get PyCharm to suppress a particular warning on a single line?

删除回忆录丶 提交于 2019-12-30 05:32:27
问题 PyCharm provides some helpful warnings on code style, conventions and logical gotchas. It also provides a notification if I try to commit code with warnings (or errors). Sometimes I consciously ignore these warnings for particular lines of code (for various reasons, typically to account for implementation details of third-party libraries). I want to suppress the warning, but just for that line (if the warning crops up on a different line where I'm not being deliberate, I want to know about it

How do I get warnings.warn to issue a warning and not ignore the line?

六月ゝ 毕业季﹏ 提交于 2019-12-29 06:37:10
问题 I'm trying to raise a DeprecationWarning , with a code snippet based on the example shown in the docs. http://docs.python.org/2/library/warnings.html#warnings.warn Official def deprecation(message): warnings.warn(message, DeprecationWarning, stacklevel=2) Mine import warnings warnings.warn("This is a warnings.", DeprecationWarning, stacklevel=2) is None # returns True I've tried removing the stacklevel argument, setting it to negative, 0, 2 and 20000. The warning is always silently swallowed.

How to disable warnings for particular include files?

五迷三道 提交于 2019-12-28 03:31:07
问题 I wold like to disable particular warnings for all files that are included, directly or indirectly, by particular include files. For example, I want to disable the warning "you are assigning a string literal to a char*", for all files or files included by files included by a #include <bar/*> (the star in my case means "anything may be here"). The reason is, some of the people I have to program with just can't use "const", so in the end I get lots of warnings about that particular string

Prevent Open Resource Pool Dialogue box when opening MPP Project File using VBA

会有一股神秘感。 提交于 2019-12-25 09:25:23
问题 I have some code that I am using to Open a Microsoft Project file but despite all efforts I have been unable to prevent the opening dialogue box from appearing or auto answering it. I have tried Application.EnableEvents = False , Application.DisplayAlaerts = False and .FileOpenEx all to no avail. I would appreciate some help. Thanks in advance. Public Sub extract_data() Dim appProj As MSProject.Application Dim aProg As MSProject.Project Dim app Dim mppApp As MSProject.Application Dim Tasks As

How to suppress several warnings but not all of them coming from libraries?

筅森魡賤 提交于 2019-12-25 08:03:05
问题 Some libraries are buggy and raise a lot of warnings one does not want to get at every compilation because it floods usefull own application warnings and errors. To suppress one type of warnings or all of them from libraries includes, the solution is here from andrewrjones and recalled here for conveniance (with a different example to make it usefull): // Crypt++ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-variable" #include "aes.h" #include "modes.h" #include

Ignore return value of a gobble-only scanf (gcc)

戏子无情 提交于 2019-12-25 01:47:16
问题 So I've read this question and other related questions, and I know that it's a good idea to check the return value of scanf to avoid surprises. But I have the following scanf in my code: /* * If we don't gobble newlines, * then they'll be interpreted as commands. * Gobble both \n and \r (because the input files use 0x0D). */ (void) scanf("%*[\n\r]"); As you can see, I'm casting the result of scanf to void , but GCC still warns under -ansi -pedantic -Wall -O3 , as noted here. Is there anything

R tryCatch handling one kind of error

旧时模样 提交于 2019-12-24 15:24:09
问题 I wondering it is the way to check in tryCatch function kind of errors or warnings like in Java for example. try { driver.findElement(By.xpath(locator)).click(); result= true; } catch (Exception e) { if(e.getMessage().contains("is not clickable at point")) { System.out.println(driver.findElement(By.xpath(locator)).getAttribute("name")+" are not clicable"); } else { System.err.println(e.getMessage()); } } finally { break; } In R I only find solution for handling all error in one ways, example

Conversion from 'xxxx' to 'yyyy', possible loss of data, suppression?

谁说胖子不能爱 提交于 2019-12-24 07:27:54
问题 Sometimes I've got warnings with conversion from a longer type to a smaller type e.g.: void f( unsigned short i ) // f - accept any numeric type // smaller than std::vector<>::size_type {} std::vector < some_type > v; .. f ( v.size() ); Usually I was using one of next solutions: assert( v.size() <= std::numeric_limits< unsigned short >::max() ); f( static_cast< unsigned short >( v.size() ) ); or f( boost::numeric_cast< unsigned short >( v.size() ) ); But on my present work boost not used and

What does the %#mex pragma do?

亡梦爱人 提交于 2019-12-24 03:18:31
问题 When I create a MEX file in MATLAB, I'm in the habit of also creating a .m file with the same name, a function signature identical to the MEX file, and otherwise containing nothing but help text in the form of comments, that are then displayed when one types help myfcn . When one does this, a small side-effect is that MATLAB Code Analyzer picks up on the fact that the input and output arguments specified in the function signature are unused, and flags them with an orange underline. Recently I