https://llvm.org/bugs/show_bug.cgi?id=23642
Bug ID: 23642
Summary: -Wincompatible-pointer-types-discards-qualifiers
should note the particular discarded qualifiers
Product: clang
Version: trunk
Hardware: PC
OS: All
Status: NEW
Severity: enhancement
Priority: P
Component: -New Bugs
Assignee: [email protected]
Reporter: [email protected]
CC: [email protected]
Classification: Unclassified
Clang 3.6 does this:
$ cat cc.c
int main() {
char * c;
char const ** c2 = &c;
}
$ clang cc.c
cc.c:3:16: warning: initializing 'const char **' with an expression of type
'char **' discards qualifiers in nested pointer types
[-Wincompatible-pointer-types-discards-qualifiers]
char const ** c2 = &c;
^ ~~
1 warning generated.
It would be very nice if something like this were emitted instead:
cc.c:3:16: warning: initializing 'const char **' with an expression of type
'char **' discards qualifiers in nested pointer types
[-Wincompatible-pointer-types-discards-qualifiers]
char const ** c2 = &c;
^ ~~
cc.c:3:7: note: nested pointer type with discarded 'const' qualifier
char const ** c2 = &c;
---- ^^^^^ -
--
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