warnings

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

Disable “Documentation Comments” warning for selected files

一笑奈何 提交于 2019-12-20 09:22:26
问题 Xcode has the ability to check for Documentation Comments issues and report warnings when something is not quite right. For instance, I've added Facebook SDK to my project using CocoaPods. At some point in the file FBError.h there's the following code: /*! @typedef NS_ENUM (NSInteger, FBErrorCategory) @abstract Indicates the Facebook SDK classification for the error @discussion */ Note that the @discussion parameter is empty, and Xcode will generate a warning accordingly: Empty paragraph

Xcode warning “Property access results unused - getters should not be used for side effects”

邮差的信 提交于 2019-12-20 09:21:56
问题 I'm getting this warning when I'm calling a local routine. My code is this: -(void)nextLetter { // NSLog(@"%s", __FUNCTION__); currentLetter ++; if(currentLetter > (letters.count - 1)) { currentLetter = 0; } self.fetchLetter; } I'm getting the warning on the self.fetchLetter statement. That routine looks like this: - (void)fetchLetter { // NSLog(@"%s", __FUNCTION__); NSString *wantedLetter = [[letters objectAtIndex: currentLetter] objectForKey: @"langLetter"]; NSString *wantedUpperCase = [

Use of undefined constant error in php

喜欢而已 提交于 2019-12-20 07:55:50
问题 The following code <?php $email_domain = "abc@gmail.com"; $email_user = "Roshan"; $email_pass = "admin"; $email_quota = "200"; $call = array(domain=>$email_domain, email=>$email_user, password=>$email_pass, quota=>$email_quota); echo json_encode($call); ?> generated following error: Notice: Use of undefined constant domain - assumed 'domain' in C:\xampp\htdocs\test2.php on line 7 Notice: Use of undefined constant email - assumed 'email' in C:\xampp\htdocs\test2.php on line 7 Notice: Use of

warning: comparison between pointer and integer in C

*爱你&永不变心* 提交于 2019-12-20 04:51:56
问题 I get a warning warning: comparison between pointer and integer on the line containing if from the next piece of code: char cwd[1024]; if (getcwd(cwd, sizeof(cwd)) != (char*)NULL) printf("%s\n",cwd); else error_print("error in pwd"); how and what do I need to fix? 回答1: Do you include unistd.h? If not, the error appears because your C compiler is assuming getcwd returns int. The fix? Include unistd.h 回答2: The prototype of getcwd is char *getcwd(char *buf, size_t size); Make sure you include

warning: comparison between pointer and integer in C

无人久伴 提交于 2019-12-20 04:51:14
问题 I get a warning warning: comparison between pointer and integer on the line containing if from the next piece of code: char cwd[1024]; if (getcwd(cwd, sizeof(cwd)) != (char*)NULL) printf("%s\n",cwd); else error_print("error in pwd"); how and what do I need to fix? 回答1: Do you include unistd.h? If not, the error appears because your C compiler is assuming getcwd returns int. The fix? Include unistd.h 回答2: The prototype of getcwd is char *getcwd(char *buf, size_t size); Make sure you include

SunStudio C++ compiler pragma to disable warnings?

半城伤御伤魂 提交于 2019-12-20 02:42:05
问题 The STLport bundled with the SunStudio11 generates alot of warnings. I beleive most compilers have a way to disable warnings from certain source files, like this: Sun C #pragma error_messages off #include <header.h> // ... #pragma error_messages on gcc #pragma warning(push, 0) #include <header.h> // ... #pragma warning(pop) How do you do this in the SunStudio C++ compiler? (btw, the sunstudio C pragmas don't work in sunstudio C++) 回答1: In SunStudio 12, the #pragma error_messages work as

C++: warning: '…' declared with greater visibility than the type of its field '…::<anonymous>'

北城以北 提交于 2019-12-19 17:46:47
问题 I'm getting these two warnings (with GCC 4.2 on MacOSX): /Users/az/Programmierung/openlierox/build/Xcode/../../src/main.cpp:154:0 /Users/az/Programmierung/openlierox/build/Xcode/../../src/main.cpp:154: warning: 'startMainLockDetector()::MainLockDetector' declared with greater visibility than the type of its field 'startMainLockDetector()::MainLockDetector::<anonymous>' /Users/az/Programmierung/openlierox/build/Xcode/../../src/main.cpp:154:0 /Users/az/Programmierung/openlierox/build/Xcode/../.

C++: warning: '…' declared with greater visibility than the type of its field '…::<anonymous>'

↘锁芯ラ 提交于 2019-12-19 17:46:13
问题 I'm getting these two warnings (with GCC 4.2 on MacOSX): /Users/az/Programmierung/openlierox/build/Xcode/../../src/main.cpp:154:0 /Users/az/Programmierung/openlierox/build/Xcode/../../src/main.cpp:154: warning: 'startMainLockDetector()::MainLockDetector' declared with greater visibility than the type of its field 'startMainLockDetector()::MainLockDetector::<anonymous>' /Users/az/Programmierung/openlierox/build/Xcode/../../src/main.cpp:154:0 /Users/az/Programmierung/openlierox/build/Xcode/../.

Why am I getting an UIBarButtonItem customization warning?

时光怂恿深爱的人放手 提交于 2019-12-19 17:43:59
问题 I have a simple storyboard with a table view inside a navigation view controller that pushes from the table view to another view controller that has a full screen image view. The table view has a prompt text in it's navigation bar. When I tap on the table view cell in the table view I receive the warning below. I'm not customizing the back button at all. I created a sample project showing the issue. https://github.com/stevemoser/UIBarButtonItemCustomizationWarningExampleProject Anyone have an