Re: FTBFS if "-Werror=format-security" flag is used

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> 1. There are legitimate use-cases where GCC's assumption does not hold, .e.g.:
>
> #include <stdio.h>
>
> void foo( int a )
> {
>   char hello0[] = "hello0";

foo.c line 5: warning: 'const' omitted

>   char hello1[] = "hello1";

foo.c line 6: warning: 'const' omitted

>
>   char *ptr;

foo.c line 8: warning: 'const' omitted

>
>   switch (a % 2) {
>   case 0: ptr = hello0;
>     break;
>   case 1: ptr = hello1;
>     break;
>   }
>
>   printf( ptr );
> }
>
> => The warning GCC issues is plain wrong.
>
> => -Werror=format-security removes the functionality of assigning pointers to format strings even if they are constant.

The example does not support this argument because the example omitted the 'const' (three places.)
gcc-4.[89] isn't advanced enough to distinguish, but the example does not match the argument.

-- 
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxxx
https://admin.fedoraproject.org/mailman/listinfo/devel
Fedora Code of Conduct: http://fedoraproject.org/code-of-conduct





[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Fedora Announce]     [Fedora Kernel]     [Fedora Testing]     [Fedora Formulas]     [Fedora PHP Devel]     [Kernel Development]     [Fedora Legacy]     [Fedora Maintainers]     [Fedora Desktop]     [PAM]     [Red Hat Development]     [Gimp]     [Yosemite News]
  Powered by Linux