Re: [PATCH] warning about const multidimensional array as function parameter

2014-10-28 Thread Martin Uecker
Hi, attached is a revised and extended patch. Changes with respect to the previous patch are: - warn if qualifiers are lost for pointers to multi-dimensional arrays - warn if qualifiers are lost when converting to void* - warnings for _Atomic are preserved - qualifiers are not lost in condit

Re: [PATCH] warning about const multidimensional array as function parameter

2014-10-27 Thread Joseph S. Myers
On Mon, 27 Oct 2014, Martin Uecker wrote: > 3.9.3(5) ... > Cv-qualifiers applied to an array type attach to the > underlying element type, so the notation "cv T," where > T is an array type, refers to an array whose elements > are so-qualified. Such array types can be said to be > more (or less) c

Re: [PATCH] warning about const multidimensional array as function parameter

2014-10-27 Thread Martin Uecker
Jonathan Wakely : > On 27 October 2014 13:10, Joseph S. Myers wrote: > > On Sat, 25 Oct 2014, Martin Uecker wrote: > > > >> Strictly speaking the C standard considers such pointers to be > >> incompatible. This seems to be an unintentional consequence > >> of how qualifiers are always attached to

Re: [PATCH] warning about const multidimensional array as function parameter

2014-10-27 Thread Jonathan Wakely
On 27 October 2014 13:10, Joseph S. Myers wrote: > On Sat, 25 Oct 2014, Martin Uecker wrote: > >> Strictly speaking the C standard considers such pointers to be >> incompatible. This seems to be an unintentional consequence >> of how qualifiers are always attached to the element type. >> (I am tryi

Re: [PATCH] warning about const multidimensional array as function parameter

2014-10-27 Thread Joseph S. Myers
On Sat, 25 Oct 2014, Martin Uecker wrote: > Strictly speaking the C standard considers such pointers to be > incompatible. This seems to be an unintentional consequence > of how qualifiers are always attached to the element type. > (I am trying to get the standard revised too.) The new > behavi

[PATCH] warning about const multidimensional array as function parameter

2014-10-25 Thread Martin Uecker
This patch implements a new proposed behaviour of diagnostics for pointers to arrays with qualifiers in C: - No warning about 'incompatible pointer types' for pointers to arrays with different qualifiers. - Instead, there is a new warning activated only with '-pedantic': "pointers to ar