You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.11) compile error.
ubuntu@VM-0-4-ubuntu:~/c4$ gcc -o c4 c4.c
c4.c: In function ‘next’:
c4.c:56:16: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘long long int’ [-Wformat=]
printf("%d: %.*s", line, p - lp, lp);
^
c4.c:56:16: warning: field precision specifier ‘.*’ expects argument of type ‘int’, but argument 3 has type ‘long int’ [-Wformat=]
c4.c:62:34: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘long long int’ [-Wformat=]
if (*le <= ADJ) printf(" %d\n", *++le); else printf("\n");
^
The text was updated successfully, but these errors were encountered:
This is a warning, not an error. There do seem to be some cases where a multi-parameter printf will fail to print some integers, but in general everything still works.
These could be changed to %ld or something, but they were likely left so that it would still work on 32bit platforms. Though, this seems to be broken as of 2feb8c0 as the target number type is too large.
For now, you could ignore the warnings (and don't compile with warnings as errors). You could also turn off the warning itself with -Wno-format .
gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.11) compile error.
The text was updated successfully, but these errors were encountered: