| This warning complains about a #line directive that is out of range according to
ANSI C, section 3.3.4, line 12:
"The digit sequence shall not specify zero, nor a number greater than 32767"
The following simple program will demonstrate the problem:
% cc t.c
cc: Warning: line32767.c, line 32768: Line number is greater than the 32767
specified by ANSI and may not be portable.
#line 32768 line32768.c
------^
% a.out
t.c: line 5
line32767.c: line 32767
line32768.c: line 32768
% cat t.c
#include <stdio.h>
void main()
{
printf("%s: line %d\n", __FILE__, __LINE__);
#line 32767 line32767.c
printf("%s: line %d\n", __FILE__, __LINE__);
#line 32768 line32768.c
printf("%s: line %d\n", __FILE__, __LINE__);
}
Note that in -std0 we get the warning. I think it needs to be there in -std and
-std1, but it may be allowable in -std0. I'll ask about that.
In any case, the #line directive "does the right thing". Note that the __LINE__
is set to a number greater than 32767, even with the warning.
-Jeff
|
| You can determine the message id for that message by adding the -verbose switch.
Once you get the message id, you can disable just that message, using #pragma
message disable line, as shown below:
#pragma message disable xtralarge
% cat t.c
#ifdef QUIET
#pragma message disable xtralarge
#endif
#line 32768
int i;
% cc t.c -c
cc: Warning: t.c, line 5: Line number is greater than the 32767 specified by
ANSI and may not be portable.
#line 32768
------^
% cc t.c -c -DQUIET
%
You could add that in one place to a common header file (hopefully).
-Jeff
|