Re: printf: Ambiguous warning

2021-03-16 Thread Jonathan Wakely via Gcc
On Tue, 16 Mar 2021 at 10:47, Rene Kita wrote: > > On Tue, Mar 16, 2021 at 11:26:29AM +0100, Jakub Jelinek wrote: > > On Tue, Mar 16, 2021 at 11:20:05AM +0100, Rene Kita wrote: > > > % gcc -Wall -Wpedantic main.c > > > main.c: In function 'main': > > > main.c:10:16: warning: format '%hn' expects a

Re: printf: Ambiguous warning

2021-03-16 Thread Rene Kita
On Tue, Mar 16, 2021 at 11:26:29AM +0100, Jakub Jelinek wrote: > On Tue, Mar 16, 2021 at 11:20:05AM +0100, Rene Kita wrote: > > % gcc -Wall -Wpedantic main.c > > main.c: In function 'main': > > main.c:10:16: warning: format '%hn' expects argument of type 'short int *', > > but argument 2 has type

Re: printf: Ambiguous warning

2021-03-16 Thread Jakub Jelinek via Gcc
On Tue, Mar 16, 2021 at 11:20:05AM +0100, Rene Kita wrote: > (Please keep me CC'd, I'm not subscribe to the list) > > Here is a minimal example: > #include > > int > main() > { > unsigned short n; > unsigned short *p; > p = &n; > > printf("p: %hn\n", p); > } > > > % gcc -Wall -Wpedant

printf: Ambiguous warning

2021-03-16 Thread Rene Kita
(Please keep me CC'd, I'm not subscribe to the list) Here is a minimal example: #include int main() { unsigned short n; unsigned short *p; p = &n; printf("p: %hn\n", p); } % gcc -Wall -Wpedantic main.c main.c: In function 'main': main.c:10:16: warning: format '%hn' expects argument of