LINUX.ORG.RU

История изменений

Исправление i_gnatenko_brain, (текущая версия) :

[brain@x1carbon ~]$ gcc t.c
t.c: In function ‘main’:
t.c:9:9: warning: passing argument 1 of ‘fun’ from incompatible pointer type [-Wincompatible-pointer-types]
     fun(&a);
         ^
t.c:1:6: note: expected ‘int *’ but argument is of type ‘short int *’
 void fun(int *val)
      ^~~
[brain@x1carbon ~]$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-redhat-linux/6.1.1/lto-wrapper
Target: x86_64-redhat-linux
Configured with: ../configure --enable-bootstrap --enable-languages=c,c++,objc,obj-c++,fortran,ada,go,lto --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-shared --enable-threads=posix --enable-checking=release --enable-multilib --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-linker-hash-style=gnu --enable-plugin --enable-initfini-array --disable-libgcj --with-isl --enable-libmpx --enable-gnu-indirect-function --with-tune=generic --with-arch_32=i686 --build=x86_64-redhat-linux
Thread model: posix
gcc version 6.1.1 20160621 (Red Hat 6.1.1-3) (GCC) 

Исходная версия i_gnatenko_brain, :

[brain@x1carbon ~]$ gcc t.c
t.c: In function ‘main’:
t.c:9:9: warning: passing argument 1 of ‘fun’ from incompatible pointer type [-Wincompatible-pointer-types]
     fun(&a);
         ^
t.c:1:6: note: expected ‘int *’ but argument is of type ‘short int *’
 void fun(int *val)
      ^~~
[brain@x1carbon ~]$ gcc --version
gcc (GCC) 6.1.1 20160621 (Red Hat 6.1.1-3)
Copyright (C) 2016 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.