S
santosh
No. The '-ansi' or '-std=c89' switches do that. The '-pedantic'
switch tells gcc to conform to the relevant language dialect as
strictly as possible.
No, the -ansi (or as you say, -std=c89) and -pedantic options are
_both_ required for gcc to attempt to conform to C89. The -ansi flag
makes sure valid programs are accepted, and the -pedantic flag makes
sure invalid programs are diagnosed. If either option is omitted, the
compiler, while perhaps useful, isn't conforming to C89/C90.
You can use see from these examples:
int main(int argc, char *argv[]) {
int typeof; /* valid declaration, must be accepted */
return 0;
}
int main(int argc, char *argv[]) {
int array[argc+1]; /* a diagnostic is required in C90 */
return 0;
}
Thanks. Now that I read the gcc manual more closely, you're right.