This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/16966] New: warning about (in)copatible pointer types **const / *const*const
- From: "schaum at uni-paderborn dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 10 Aug 2004 14:37:55 -0000
- Subject: [Bug c/16966] New: warning about (in)copatible pointer types **const / *const*const
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
Compiling following code with gcc results in the shown error. Since x in f() is
more restricted than ppx in main(), it should be ok (like for g())!?
// gcc 3.2.2 / 3.3.3 / 3.4.1
// warning: passing arg 1 of `f' from incompatible pointer type
void f(const int *const *const x) {
}
void g(const int *const x) {
}
int main(int argc, char * argv[])
{
int x;
int * px = &x;
int **const ppx = &px;
f(ppx);
g(px);
return 0;
}
--
Summary: warning about (in)copatible pointer types **const /
*const*const
Product: gcc
Version: 3.4.1
Status: UNCONFIRMED
Severity: minor
Priority: P2
Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: schaum at uni-paderborn dot de
CC: gcc-bugs at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16966