http://llvm.org/bugs/show_bug.cgi?id=20554
Bug ID: 20554
Summary: Requesting new warning: missing const-qualifier
Product: clang
Version: unspecified
Hardware: All
OS: All
Status: NEW
Severity: enhancement
Priority: P
Component: Driver
Assignee: [email protected]
Reporter: [email protected]
CC: [email protected]
Classification: Unclassified
To help facilitate "const-poisoning" of the entire body of C (and C++) code out
there, I'd like to see a new warning, that would fire, when a pointer to any
object in any scope, that could've been marked as "const", is not.
For example:
size_t
mylen(char *string)
{
if (string == NULL)
return 0;
else
return strlen(string);
}
The above code would warn, because the function's parameter could be made
const. As the developer fixes the low-level functions to address the warning,
the higher level callers of these functions will start warning -- and that will
be a beautiful thing...
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs