Skip to main content
Notice removed Authoritative reference needed by Macmade
Bounty Ended with Chandler Carruth's answer chosen by Macmade
added 213 characters in body
Source Link
Macmade
  • 1.2k
  • 2
  • 8
  • 12

As a C & Objective-C programmer, I'm a bit paranoid with the compiler warning flags.
I usually try to find a complete list of warning flags for the compiler I use, and turn most of them on, unless I have a really good reason not to turn it on.

I personally think this may actually improve coding skills, as well as potential code portability, prevent some issues, as it forces you to be aware of every little detail, potential implementation and architecture issues, and so on...

It's also in my opinion a good every day learning tool, even if you're an experienced programmer.

For the subjective part of this question, I'm interested in hearing other developers (mainly C, Objective-C and C++) about this topic.
Do you actually care about stuff like pedantic warnings, etc? And if yes or no, why?

Now about Objective-C, I recently completely switched to the LLVM toolchain (with Clang), instead of GCC.

On my production code, I usually set this warning flags (explicitly, even if some of them may be covered by -Wall):

  • -Wall
  • -Wbad-function-cast
  • -Wcast-align
  • -Wconversion
  • -Wdeclaration-after-statement
  • -Wdeprecated-implementations
  • -Wextra
  • -Wfloat-equal
  • -Wformat=2
  • -Wformat-nonliteral
  • -Wfour-char-constants
  • -Wimplicit-atomic-properties
  • -Wmissing-braces
  • -Wmissing-declarations
  • -Wmissing-field-initializers
  • -Wmissing-format-attribute
  • -Wmissing-noreturn
  • -Wmissing-prototypes
  • -Wnested-externs
  • -Wnewline-eof
  • -Wold-style-definition
  • -Woverlength-strings
  • -Wparentheses
  • -Wpointer-arith
  • -Wredundant-decls
  • -Wreturn-type
  • -Wsequence-point
  • -Wshadow
  • -Wshorten-64-to-32
  • -Wsign-compare
  • -Wsign-conversion
  • -Wstrict-prototypes
  • -Wstrict-selector-match
  • -Wswitch
  • -Wswitch-default
  • -Wswitch-enum
  • -Wundeclared-selector
  • -Wuninitialized
  • -Wunknown-pragmas
  • -Wunreachable-code
  • -Wunused-function
  • -Wunused-label
  • -Wunused-parameter
  • -Wunused-value
  • -Wunused-variable
  • -Wwrite-strings

I'm interested in hearing what other developers have to say about this.

For instance, do you think I missed a particular flag for Clang (Objective-C), and why?
Or do you think a particular flag is not useful (or not wanted at all), and why?

EDIT

To clarify the question, note that -Wall only provides a few basic warnings.
They are actually a lot more warning flags, not covered by -Wall, hence the question, and the list I provide.

As a C & Objective-C programmer, I'm a bit paranoid with the compiler warning flags.
I usually try to find a complete list of warning flags for the compiler I use, and turn most of them on, unless I have a really good reason not to turn it on.

I personally think this may actually improve coding skills, as well as potential code portability, prevent some issues, as it forces you to be aware of every little detail, potential implementation and architecture issues, and so on...

It's also in my opinion a good every day learning tool, even if you're an experienced programmer.

For the subjective part of this question, I'm interested in hearing other developers (mainly C, Objective-C and C++) about this topic.
Do you actually care about stuff like pedantic warnings, etc? And if yes or no, why?

Now about Objective-C, I recently completely switched to the LLVM toolchain (with Clang), instead of GCC.

On my production code, I usually set this warning flags (explicitly, even if some of them may be covered by -Wall):

  • -Wall
  • -Wbad-function-cast
  • -Wcast-align
  • -Wconversion
  • -Wdeclaration-after-statement
  • -Wdeprecated-implementations
  • -Wextra
  • -Wfloat-equal
  • -Wformat=2
  • -Wformat-nonliteral
  • -Wfour-char-constants
  • -Wimplicit-atomic-properties
  • -Wmissing-braces
  • -Wmissing-declarations
  • -Wmissing-field-initializers
  • -Wmissing-format-attribute
  • -Wmissing-noreturn
  • -Wmissing-prototypes
  • -Wnested-externs
  • -Wnewline-eof
  • -Wold-style-definition
  • -Woverlength-strings
  • -Wparentheses
  • -Wpointer-arith
  • -Wredundant-decls
  • -Wreturn-type
  • -Wsequence-point
  • -Wshadow
  • -Wshorten-64-to-32
  • -Wsign-compare
  • -Wsign-conversion
  • -Wstrict-prototypes
  • -Wstrict-selector-match
  • -Wswitch
  • -Wswitch-default
  • -Wswitch-enum
  • -Wundeclared-selector
  • -Wuninitialized
  • -Wunknown-pragmas
  • -Wunreachable-code
  • -Wunused-function
  • -Wunused-label
  • -Wunused-parameter
  • -Wunused-value
  • -Wunused-variable
  • -Wwrite-strings

I'm interested in hearing what other developers have to say about this.

For instance, do you think I missed a particular flag for Clang (Objective-C), and why?
Or do you think a particular flag is not useful (or not wanted at all), and why?

As a C & Objective-C programmer, I'm a bit paranoid with the compiler warning flags.
I usually try to find a complete list of warning flags for the compiler I use, and turn most of them on, unless I have a really good reason not to turn it on.

I personally think this may actually improve coding skills, as well as potential code portability, prevent some issues, as it forces you to be aware of every little detail, potential implementation and architecture issues, and so on...

It's also in my opinion a good every day learning tool, even if you're an experienced programmer.

For the subjective part of this question, I'm interested in hearing other developers (mainly C, Objective-C and C++) about this topic.
Do you actually care about stuff like pedantic warnings, etc? And if yes or no, why?

Now about Objective-C, I recently completely switched to the LLVM toolchain (with Clang), instead of GCC.

On my production code, I usually set this warning flags (explicitly, even if some of them may be covered by -Wall):

  • -Wall
  • -Wbad-function-cast
  • -Wcast-align
  • -Wconversion
  • -Wdeclaration-after-statement
  • -Wdeprecated-implementations
  • -Wextra
  • -Wfloat-equal
  • -Wformat=2
  • -Wformat-nonliteral
  • -Wfour-char-constants
  • -Wimplicit-atomic-properties
  • -Wmissing-braces
  • -Wmissing-declarations
  • -Wmissing-field-initializers
  • -Wmissing-format-attribute
  • -Wmissing-noreturn
  • -Wmissing-prototypes
  • -Wnested-externs
  • -Wnewline-eof
  • -Wold-style-definition
  • -Woverlength-strings
  • -Wparentheses
  • -Wpointer-arith
  • -Wredundant-decls
  • -Wreturn-type
  • -Wsequence-point
  • -Wshadow
  • -Wshorten-64-to-32
  • -Wsign-compare
  • -Wsign-conversion
  • -Wstrict-prototypes
  • -Wstrict-selector-match
  • -Wswitch
  • -Wswitch-default
  • -Wswitch-enum
  • -Wundeclared-selector
  • -Wuninitialized
  • -Wunknown-pragmas
  • -Wunreachable-code
  • -Wunused-function
  • -Wunused-label
  • -Wunused-parameter
  • -Wunused-value
  • -Wunused-variable
  • -Wwrite-strings

I'm interested in hearing what other developers have to say about this.

For instance, do you think I missed a particular flag for Clang (Objective-C), and why?
Or do you think a particular flag is not useful (or not wanted at all), and why?

EDIT

To clarify the question, note that -Wall only provides a few basic warnings.
They are actually a lot more warning flags, not covered by -Wall, hence the question, and the list I provide.

LLVM -> [LLVM](http://en.wikipedia.org/wiki/Low_Level_Virtual_Machine)
Source Link

As a C & Objective-C programmer, I'm a bit paranoid with the compiler warning flags.
I usually try to find a complete list of warning flags for the compiler I use, and turn most of them on, unless I have a really good reason not to turn it on.

I personally think this may actually improve coding skills, as well as potential code portability, prevent some issues, as it forces you to be aware of every little detail, potential implementation and architecture issues, and so on...

It's also in my opinion a good every day learning tool, even if you're an experienced programmer.

For the subjective part of this question, I'm interested in hearing other developers (mainly C, Objective-C and C++) about this topic.
Do you actually care about stuff like pedantic warnings, etc? And if yes or no, why?

Now about Objective-C, I recently completely switched to the LLVMLLVM toolchain (with Clang), instead of GCC.

On my production code, I usually set this warning flags (explicitly, even if some of them may be covered by -Wall):

  • -Wall
  • -Wbad-function-cast
  • -Wcast-align
  • -Wconversion
  • -Wdeclaration-after-statement
  • -Wdeprecated-implementations
  • -Wextra
  • -Wfloat-equal
  • -Wformat=2
  • -Wformat-nonliteral
  • -Wfour-char-constants
  • -Wimplicit-atomic-properties
  • -Wmissing-braces
  • -Wmissing-declarations
  • -Wmissing-field-initializers
  • -Wmissing-format-attribute
  • -Wmissing-noreturn
  • -Wmissing-prototypes
  • -Wnested-externs
  • -Wnewline-eof
  • -Wold-style-definition
  • -Woverlength-strings
  • -Wparentheses
  • -Wpointer-arith
  • -Wredundant-decls
  • -Wreturn-type
  • -Wsequence-point
  • -Wshadow
  • -Wshorten-64-to-32
  • -Wsign-compare
  • -Wsign-conversion
  • -Wstrict-prototypes
  • -Wstrict-selector-match
  • -Wswitch
  • -Wswitch-default
  • -Wswitch-enum
  • -Wundeclared-selector
  • -Wuninitialized
  • -Wunknown-pragmas
  • -Wunreachable-code
  • -Wunused-function
  • -Wunused-label
  • -Wunused-parameter
  • -Wunused-value
  • -Wunused-variable
  • -Wwrite-strings

I'm interested in hearing what other developers have to say about this.

For instance, do you think I missed a particular flag for Clang (Objective-C), and why?
Or do you think a particular flag is not useful (or not wanted at all), and why?

As a C & Objective-C programmer, I'm a bit paranoid with the compiler warning flags.
I usually try to find a complete list of warning flags for the compiler I use, and turn most of them on, unless I have a really good reason not to turn it on.

I personally think this may actually improve coding skills, as well as potential code portability, prevent some issues, as it forces you to be aware of every little detail, potential implementation and architecture issues, and so on...

It's also in my opinion a good every day learning tool, even if you're an experienced programmer.

For the subjective part of this question, I'm interested in hearing other developers (mainly C, Objective-C and C++) about this topic.
Do you actually care about stuff like pedantic warnings, etc? And if yes or no, why?

Now about Objective-C, I recently completely switched to the LLVM toolchain (with Clang), instead of GCC.

On my production code, I usually set this warning flags (explicitly, even if some of them may be covered by -Wall):

  • -Wall
  • -Wbad-function-cast
  • -Wcast-align
  • -Wconversion
  • -Wdeclaration-after-statement
  • -Wdeprecated-implementations
  • -Wextra
  • -Wfloat-equal
  • -Wformat=2
  • -Wformat-nonliteral
  • -Wfour-char-constants
  • -Wimplicit-atomic-properties
  • -Wmissing-braces
  • -Wmissing-declarations
  • -Wmissing-field-initializers
  • -Wmissing-format-attribute
  • -Wmissing-noreturn
  • -Wmissing-prototypes
  • -Wnested-externs
  • -Wnewline-eof
  • -Wold-style-definition
  • -Woverlength-strings
  • -Wparentheses
  • -Wpointer-arith
  • -Wredundant-decls
  • -Wreturn-type
  • -Wsequence-point
  • -Wshadow
  • -Wshorten-64-to-32
  • -Wsign-compare
  • -Wsign-conversion
  • -Wstrict-prototypes
  • -Wstrict-selector-match
  • -Wswitch
  • -Wswitch-default
  • -Wswitch-enum
  • -Wundeclared-selector
  • -Wuninitialized
  • -Wunknown-pragmas
  • -Wunreachable-code
  • -Wunused-function
  • -Wunused-label
  • -Wunused-parameter
  • -Wunused-value
  • -Wunused-variable
  • -Wwrite-strings

I'm interested in hearing what other developers have to say about this.

For instance, do you think I missed a particular flag for Clang (Objective-C), and why?
Or do you think a particular flag is not useful (or not wanted at all), and why?

As a C & Objective-C programmer, I'm a bit paranoid with the compiler warning flags.
I usually try to find a complete list of warning flags for the compiler I use, and turn most of them on, unless I have a really good reason not to turn it on.

I personally think this may actually improve coding skills, as well as potential code portability, prevent some issues, as it forces you to be aware of every little detail, potential implementation and architecture issues, and so on...

It's also in my opinion a good every day learning tool, even if you're an experienced programmer.

For the subjective part of this question, I'm interested in hearing other developers (mainly C, Objective-C and C++) about this topic.
Do you actually care about stuff like pedantic warnings, etc? And if yes or no, why?

Now about Objective-C, I recently completely switched to the LLVM toolchain (with Clang), instead of GCC.

On my production code, I usually set this warning flags (explicitly, even if some of them may be covered by -Wall):

  • -Wall
  • -Wbad-function-cast
  • -Wcast-align
  • -Wconversion
  • -Wdeclaration-after-statement
  • -Wdeprecated-implementations
  • -Wextra
  • -Wfloat-equal
  • -Wformat=2
  • -Wformat-nonliteral
  • -Wfour-char-constants
  • -Wimplicit-atomic-properties
  • -Wmissing-braces
  • -Wmissing-declarations
  • -Wmissing-field-initializers
  • -Wmissing-format-attribute
  • -Wmissing-noreturn
  • -Wmissing-prototypes
  • -Wnested-externs
  • -Wnewline-eof
  • -Wold-style-definition
  • -Woverlength-strings
  • -Wparentheses
  • -Wpointer-arith
  • -Wredundant-decls
  • -Wreturn-type
  • -Wsequence-point
  • -Wshadow
  • -Wshorten-64-to-32
  • -Wsign-compare
  • -Wsign-conversion
  • -Wstrict-prototypes
  • -Wstrict-selector-match
  • -Wswitch
  • -Wswitch-default
  • -Wswitch-enum
  • -Wundeclared-selector
  • -Wuninitialized
  • -Wunknown-pragmas
  • -Wunreachable-code
  • -Wunused-function
  • -Wunused-label
  • -Wunused-parameter
  • -Wunused-value
  • -Wunused-variable
  • -Wwrite-strings

I'm interested in hearing what other developers have to say about this.

For instance, do you think I missed a particular flag for Clang (Objective-C), and why?
Or do you think a particular flag is not useful (or not wanted at all), and why?

Notice added Authoritative reference needed by Macmade
Bounty Started worth 100 reputation by Macmade
Tweeted twitter.com/#!/StackProgrammer/status/142156778736582656
deleted 204 characters in body
Source Link
Adam Lear
  • 32k
  • 8
  • 103
  • 125

As a C & Objective-C programmer, I'm a bit paranoid with the compiler warning flags.
I usually try to find a complete list of warning flags for the compiler I use, and turn most of them on, unless I have a really good reason not to turn it on.

I personally think this may actually improve coding skills, as well as potential code portability, prevent some issues, as it forces you to be aware of every little detail, potential implementation and architecture issues, and so on...

It's also in my opinion a good every day learning tool, even if you're an experienced programmer.

For the subjective part of this question, I'm interested in hearing other developers (mainly C, Objective-C and C++) about this topic.
Do you actually care about stuff like pedantic warnings, etc? And if yes or no, why?

Now about Objective-C, I recently completely switched to the LLVM toolchain (with Clang), instead of GCC.

On my production code, I usually set this warning flags (explicitly, even if some of them may be covered by -Wall):

  • -Wall
  • -Wbad-function-cast
  • -Wcast-align
  • -Wconversion
  • -Wdeclaration-after-statement
  • -Wdeprecated-implementations
  • -Wextra
  • -Wfloat-equal
  • -Wformat=2
  • -Wformat-nonliteral
  • -Wfour-char-constants
  • -Wimplicit-atomic-properties
  • -Wmissing-braces
  • -Wmissing-declarations
  • -Wmissing-field-initializers
  • -Wmissing-format-attribute
  • -Wmissing-noreturn
  • -Wmissing-prototypes
  • -Wnested-externs
  • -Wnewline-eof
  • -Wold-style-definition
  • -Woverlength-strings
  • -Wparentheses
  • -Wpointer-arith
  • -Wredundant-decls
  • -Wreturn-type
  • -Wsequence-point
  • -Wshadow
  • -Wshorten-64-to-32
  • -Wsign-compare
  • -Wsign-conversion
  • -Wstrict-prototypes
  • -Wstrict-selector-match
  • -Wswitch
  • -Wswitch-default
  • -Wswitch-enum
  • -Wundeclared-selector
  • -Wuninitialized
  • -Wunknown-pragmas
  • -Wunreachable-code
  • -Wunused-function
  • -Wunused-label
  • -Wunused-parameter
  • -Wunused-value
  • -Wunused-variable
  • -Wwrite-strings

I'm interested in hearing what other developers have to say about this.

For instance, do you think I missed a particular flag for Clang (Objective-C), and why?
Or do you think a particular flag is not useful (or not wanted at all), and why?

I hope this question will stick the StackOverflow guidelines, even if it may be a bit subjective.
I hesitated to post it on http://programmers.stackexchange.com; I think this is a better place.

As a C & Objective-C programmer, I'm a bit paranoid with the compiler warning flags.
I usually try to find a complete list of warning flags for the compiler I use, and turn most of them on, unless I have a really good reason not to turn it on.

I personally think this may actually improve coding skills, as well as potential code portability, prevent some issues, as it forces you to be aware of every little detail, potential implementation and architecture issues, and so on...

It's also in my opinion a good every day learning tool, even if you're an experienced programmer.

For the subjective part of this question, I'm interested in hearing other developers (mainly C, Objective-C and C++) about this topic.
Do you actually care about stuff like pedantic warnings, etc? And if yes or no, why?

Now about Objective-C, I recently completely switched to the LLVM toolchain (with Clang), instead of GCC.

On my production code, I usually set this warning flags (explicitly, even if some of them may be covered by -Wall):

  • -Wall
  • -Wbad-function-cast
  • -Wcast-align
  • -Wconversion
  • -Wdeclaration-after-statement
  • -Wdeprecated-implementations
  • -Wextra
  • -Wfloat-equal
  • -Wformat=2
  • -Wformat-nonliteral
  • -Wfour-char-constants
  • -Wimplicit-atomic-properties
  • -Wmissing-braces
  • -Wmissing-declarations
  • -Wmissing-field-initializers
  • -Wmissing-format-attribute
  • -Wmissing-noreturn
  • -Wmissing-prototypes
  • -Wnested-externs
  • -Wnewline-eof
  • -Wold-style-definition
  • -Woverlength-strings
  • -Wparentheses
  • -Wpointer-arith
  • -Wredundant-decls
  • -Wreturn-type
  • -Wsequence-point
  • -Wshadow
  • -Wshorten-64-to-32
  • -Wsign-compare
  • -Wsign-conversion
  • -Wstrict-prototypes
  • -Wstrict-selector-match
  • -Wswitch
  • -Wswitch-default
  • -Wswitch-enum
  • -Wundeclared-selector
  • -Wuninitialized
  • -Wunknown-pragmas
  • -Wunreachable-code
  • -Wunused-function
  • -Wunused-label
  • -Wunused-parameter
  • -Wunused-value
  • -Wunused-variable
  • -Wwrite-strings

I'm interested in hearing what other developers have to say about this.

For instance, do you think I missed a particular flag for Clang (Objective-C), and why?
Or do you think a particular flag is not useful (or not wanted at all), and why?

I hope this question will stick the StackOverflow guidelines, even if it may be a bit subjective.
I hesitated to post it on http://programmers.stackexchange.com; I think this is a better place.

As a C & Objective-C programmer, I'm a bit paranoid with the compiler warning flags.
I usually try to find a complete list of warning flags for the compiler I use, and turn most of them on, unless I have a really good reason not to turn it on.

I personally think this may actually improve coding skills, as well as potential code portability, prevent some issues, as it forces you to be aware of every little detail, potential implementation and architecture issues, and so on...

It's also in my opinion a good every day learning tool, even if you're an experienced programmer.

For the subjective part of this question, I'm interested in hearing other developers (mainly C, Objective-C and C++) about this topic.
Do you actually care about stuff like pedantic warnings, etc? And if yes or no, why?

Now about Objective-C, I recently completely switched to the LLVM toolchain (with Clang), instead of GCC.

On my production code, I usually set this warning flags (explicitly, even if some of them may be covered by -Wall):

  • -Wall
  • -Wbad-function-cast
  • -Wcast-align
  • -Wconversion
  • -Wdeclaration-after-statement
  • -Wdeprecated-implementations
  • -Wextra
  • -Wfloat-equal
  • -Wformat=2
  • -Wformat-nonliteral
  • -Wfour-char-constants
  • -Wimplicit-atomic-properties
  • -Wmissing-braces
  • -Wmissing-declarations
  • -Wmissing-field-initializers
  • -Wmissing-format-attribute
  • -Wmissing-noreturn
  • -Wmissing-prototypes
  • -Wnested-externs
  • -Wnewline-eof
  • -Wold-style-definition
  • -Woverlength-strings
  • -Wparentheses
  • -Wpointer-arith
  • -Wredundant-decls
  • -Wreturn-type
  • -Wsequence-point
  • -Wshadow
  • -Wshorten-64-to-32
  • -Wsign-compare
  • -Wsign-conversion
  • -Wstrict-prototypes
  • -Wstrict-selector-match
  • -Wswitch
  • -Wswitch-default
  • -Wswitch-enum
  • -Wundeclared-selector
  • -Wuninitialized
  • -Wunknown-pragmas
  • -Wunreachable-code
  • -Wunused-function
  • -Wunused-label
  • -Wunused-parameter
  • -Wunused-value
  • -Wunused-variable
  • -Wwrite-strings

I'm interested in hearing what other developers have to say about this.

For instance, do you think I missed a particular flag for Clang (Objective-C), and why?
Or do you think a particular flag is not useful (or not wanted at all), and why?

Post Migrated Here from stackoverflow.com (revisions)
Source Link
Macmade
  • 1.2k
  • 2
  • 8
  • 12
Loading