http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57133
Bug #: 57133
Summary: false const qualifier warning typedef
Classification: Unclassified
Product: gcc
Version: 4.8.0
Status: UNCONFIRMED
Severity: minor
Priority: P3
Component: c
AssignedTo: [email protected]
ReportedBy: [email protected]
typedef char *type;
void f(const type t)
{
}
int main(void)
{
const char *str = "string";
f(str);
return 0;
}
warning: passing argument 1 of 'f' discards 'const' qualifier from pointer
target type [enabled by default]
f(str);
^
note: expected 'type' but argument is of type 'const char *'
void f(const type t)
^
It is similar with gcc 4.5.3.