Bug 25897 - GCC rejects the following strictly conforming code with -ansi -pedantic errors
Summary: GCC rejects the following strictly conforming code with -ansi -pedantic errors
Status: RESOLVED INVALID
Alias: None
Product: gcc
Classification: Unclassified
Component: c (show other bugs)
Version: 4.1.0
: P3 minor
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-01-21 07:06 UTC by Neil Booth
Modified: 2006-01-21 08:02 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Neil Booth 2006-01-21 07:06:23 UTC
void foo (const int (*h)[2], int (*i)[2])
{
  1 ? h: i;
}

Also rejected in C99 mode.
Comment 1 Andrew Pinski 2006-01-21 07:19:06 UTC
Subject: Re:   New: GCC rejects the following strictly conforming code with -ansi -pedantic errors

> 
> void foo (const int (*h)[2], int (*i)[2])
> {
>   1 ? h: i;
> }
> 
> Also rejected in C99 mode.

ICC warns:
t.c(3): warning #42: operand types are incompatible ("const int (*)[2]" and "int (*)[2]")

So maybe this is not valid C, I don't know.


-- Pinski
Comment 2 Neil Booth 2006-01-21 08:02:42 UTC
Discussing with pinskia, I believe qualifying the array type is intended to be viewed as qualifying the element type, not the array, so the example is invalid.