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
<limits.h>
{LINE_MAX}
Unless otherwise noted, the maximum length, in bytes, of a utility's input line (either standard input or another file), when the utility is described as processing text files. The length includes room for the trailing <newline>.
Minimum Acceptable Value: {_POSIX2_LINE_MAX}
so a C file with 100KB line length is not a valid textfile (LINE_MAX is typically 4KB).
---------- Forwarded message ---------
From: nikonsmith [email protected]
Date: Mon, Jul 20, 2015 at 10:49 PM
Subject: lcc's cpp bug
To: [email protected] [email protected]
cpp bug:
when I compile a c source file which have a line that much than 32KB, it then print `Input buffer overflow' and exit process.
for example, I write a program generate a c source file that 100KB in one line,as follow:
/* generate.c */
include <stdio.h>
int code_len = 100*1024; // 100KB c source code
int main(void) {
char *str="int a%04d=10;";
int str_len = 13;
int str_nr = code_len / str_len;
int i;
for(i=0;i<str_nr;i++) {
printf(str,i);
}
printf("\nint main(void) { return 0; }\n");
return 0;
}
$ ./generate > 100k.c
$ lcc -v 100k.c
cpp: 100k.c:1 Input buffer overflow
The text was updated successfully, but these errors were encountered: