1 |
Peter S Mazinger writes: |
2 |
|
3 |
> int __guard = '\0\0\n\777'; |
4 |
|
5 |
> warning: octal escape sequence out of range |
6 |
> warning: multi-character character constant |
7 |
|
8 |
By changing the value to '\0\0\n\0777' you can get rid of |
9 |
the warning. Quoting from the C99 standard: |
10 |
|
11 |
6.4.4.1 Integer constants |
12 |
|
13 |
[...] |
14 |
|
15 |
[#3] A decimal constant begins with a nonzero digit and |
16 |
consists of a sequence of decimal digits. An octal constant |
17 |
consists of the prefix 0 optionally followed by a sequence |
18 |
of the digits 0 through 7 only. A hexadecimal constant |
19 |
consists of the prefix 0x or 0X followed by a sequence of |
20 |
the decimal digits and the letters a (or A) through f (or F) |
21 |
with values 10 through 15 respectively. |
22 |
|
23 |
Unfortunately, this produces the warning |
24 |
|
25 |
character constant too long for its type |
26 |
|
27 |
instead, because the whole idea of multi-byte '...' |
28 |
constants doesn't exist. I _assume_, what the author _meant_ |
29 |
is the value |
30 |
|
31 |
10*256+(((7*8)+7)*8)+7 |
32 |
|
33 |
but I'm not certain. |
34 |
|
35 |
Peter |
36 |
|
37 |
|
38 |
-- |
39 |
gentoo-hardened@g.o mailing list |