Re: Const flagged as incompatible argument

2021-10-17 Thread Jonathan Wakely via Gcc
On Sun, 17 Oct 2021, 23:11 Zoltán Kócsi, wrote: > Consider the following code segment: > > voidfoo( const char * const m[] ); > > char*bar( void ); > > voidbaz( void ) > { > char*m[ 2 ]; > > m[ 0 ] = bar(); > m[ 1 ] = bar(); > > foo( m ); > } > > gcc 8.2.0

Const flagged as incompatible argument

2021-10-17 Thread Zoltán Kócsi
Consider the following code segment: voidfoo( const char * const m[] ); char*bar( void ); voidbaz( void ) { char*m[ 2 ]; m[ 0 ] = bar(); m[ 1 ] = bar(); foo( m ); } gcc 8.2.0 (and 7.4.1 as well) with -Wall gives a warning, for Intel or ARM target: test