This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

warning: passing `char' to argument 2 of `strcpy(char *, const char *)' lacks a cast


Shouldn't these warnings being errors instead ? I see no case where
it can be something else than a typo and in a big compilation a
meaningful warning can go unnoticed within meaningless ones.

renaissance.loria.fr:~/dvp/gally/magna #437 >cat >blah.cc
#include <string.h>

int main()  
{
  char tab[5];
  strcpy(tab, 'a');
  return 0;
}
renaissance.loria.fr:~/dvp/gally/magna #438 >g++ blah.cc -o blah
blah.cc: In function `int main()':
blah.cc:6: warning: passing `char' to argument 2 of `strcpy(char *, const char *)' lacks a cast
renaissance.loria.fr:~/dvp/gally/magna #439 >gcc blah.cc -o blah
blah.cc: In function `int main()':
blah.cc:6: warning: passing `char' to argument 2 of `strcpy(char *, const char *)' lacks a cast


renaissance.loria.fr:~/dvp/gally/magna #440 >gcc -v
Reading specs from /users/model/galibert/lib/gcc-lib/sparc-sun-solaris2.5.1/egcs-2.90.12/specs
gcc version egcs-2.90.12 971008 (gcc2-970802 experimental)

  OG.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]