compiler-warnings

Xcode: LLVM 7.0: Disable warning “Umbrella header for module does not include header”

廉价感情. 提交于 2019-12-21 07:45:32
问题 In order for my Objective-C framework to link successfully in my Swift cocoa touch framework, I had to use this unpretty workaround, which involves importing all framework headers into the project as public headers. I totally don't need all of them appearing in my umbrella header, so I want to somehow remove the bunch of warnings generated. ("Umbrella header for module 'Foo' does not include header"). I went through LLVM warning settings in the build settings, but could not found it. 回答1: If

How to get warnings of incorrect string formatting (C++)

▼魔方 西西 提交于 2019-12-20 11:56:05
问题 apologies in advance if i use poor terminology. when i compile a C++ app under gdb and use printf() it gives me awesome warnings relating to the consistency of the format string and the arguments passed in. eg, this code: printf("%s %s", "foo"); results in a compiler warning "too few arguments for format", which is super-useful. it will also give warnings about format string type vs. argument type. it must have inspected the format string and compared that against the supplied argument types.

Is there a DCC32 option to treat a specific compiler warning as an error?

孤人 提交于 2019-12-20 10:23:43
问题 For command-line builds, I would like to treat warnings (for example "Constructing instance containing abstract method") as errors. I have not found a dcc32 command line option for this purpose in Delphi 2009. Is there a way, for example using dcc32.cfg, to do this? 回答1: Like this: dcc32 -W^^CONSTRUCTING_ABSTRACT MyProject.dpr For example, with this program: program MyProject; type TMyClass = class procedure X; virtual; abstract; end; begin TMyClass.Create; end. And here's the output: >dcc32

Impact on style of GHC -Wall

感情迁移 提交于 2019-12-20 09:53:09
问题 It is considered good practice to enable GHC warnings with -Wall . However, I've found out that fixing those warnings has a negative effect for some types of code constructs. Example 1: Using the do-notation equivalent of f >> will generate a warning if I don't explicitly use the _ <- f form: Warning: A do-notation statement discarded a result of type Char. Suppress this warning by saying "_ <- f", or by using the flag -fno-warn-unused-do-bind I understand that I can forget to do something

Impact on style of GHC -Wall

独自空忆成欢 提交于 2019-12-20 09:50:59
问题 It is considered good practice to enable GHC warnings with -Wall . However, I've found out that fixing those warnings has a negative effect for some types of code constructs. Example 1: Using the do-notation equivalent of f >> will generate a warning if I don't explicitly use the _ <- f form: Warning: A do-notation statement discarded a result of type Char. Suppress this warning by saying "_ <- f", or by using the flag -fno-warn-unused-do-bind I understand that I can forget to do something

Where do I change the setting in Eclipse so that it would generate serialVersionUID for Serializable classes?

非 Y 不嫁゛ 提交于 2019-12-20 03:17:29
问题 I want Eclipse to generate a serialVersionUID for classes that implement Serializable . However, my Eclipse instance does not throw me a warning or an error when I create a class that implements Serializable . Also, it does not give an suggestion about adding a generated serialVersionUID . Where do I change the required setting? 回答1: To turn on warning for Serializable class without a serialVersionID, go to Window > Preference > Java > Compiler > Errors/Warnings and search for Serializable

‘noreturn’ function does return

青春壹個敷衍的年華 提交于 2019-12-19 16:34:13
问题 When I compile the C program below, I get this warning: ‘noreturn’ function does return . This is the function: void hello(void){ int i; i=1; } Why could it be happening? All the call to this function is hello(); EDIT: The full error output: home.c: In function ‘hello’: hhme.c:838:7: error: variable ‘i’ set but not used [-Werror=unused-but-set-variable] home.c:840:1: error: ‘noreturn’ function does return [-Werror] cc1: all warnings being treated as errors make: *** [home.o] Error 1 回答1: It

‘noreturn’ function does return

左心房为你撑大大i 提交于 2019-12-19 16:33:09
问题 When I compile the C program below, I get this warning: ‘noreturn’ function does return . This is the function: void hello(void){ int i; i=1; } Why could it be happening? All the call to this function is hello(); EDIT: The full error output: home.c: In function ‘hello’: hhme.c:838:7: error: variable ‘i’ set but not used [-Werror=unused-but-set-variable] home.c:840:1: error: ‘noreturn’ function does return [-Werror] cc1: all warnings being treated as errors make: *** [home.o] Error 1 回答1: It

In Haskell, what does it mean if a binding “shadows an existing binding”?

孤人 提交于 2019-12-19 05:49:35
问题 I'm getting a warning from GHC when I compile: Warning: This binding for 'pats' shadows an existing binding in the definition of 'match_ignore_ancs' Here's the function: match_ignore_ancs (TextPat _ c) (Text t) = c t match_ignore_ancs (TextPat _ _) (Element _ _ _) = False match_ignore_ancs (ElemPat _ _ _) (Text t) = False match_ignore_ancs (ElemPat _ c pats) (Element t avs xs) = c t avs && match_pats pats xs Any idea what this means and how I can fix it? Cheers. 回答1: It means that you have a

In Haskell, what does it mean if a binding “shadows an existing binding”?

自作多情 提交于 2019-12-19 05:49:33
问题 I'm getting a warning from GHC when I compile: Warning: This binding for 'pats' shadows an existing binding in the definition of 'match_ignore_ancs' Here's the function: match_ignore_ancs (TextPat _ c) (Text t) = c t match_ignore_ancs (TextPat _ _) (Element _ _ _) = False match_ignore_ancs (ElemPat _ _ _) (Text t) = False match_ignore_ancs (ElemPat _ c pats) (Element t avs xs) = c t avs && match_pats pats xs Any idea what this means and how I can fix it? Cheers. 回答1: It means that you have a