is -pedantic bad flag?



Hi!

I write this code cos.c

#include <math.h>
#include <stdio.h>

int main(void)
{
double c;
c = cos(0);
printf("cos(0): %f\n", c);
return 0;
}

I compile normal and it work.

I compile with -pedantic and it not work.

Is -pedantic bad flag?

Is code bug?

I use lcc -pedantic cos.c and he warn

Error cos.c: c:\lcc\include\math.h: 36 Syntax error; missing semicolon before `_cosl'
Warning cos.c: c:\lcc\include\math.h: 36 no type specified. Defaulting to int
Error cos.c: c:\lcc\include\math.h: 99 Syntax error; missing semicolon before `fabsl'
Warning cos.c: c:\lcc\include\math.h: 99 no type specified. Defaulting to int
Error cos.c: c:\lcc\include\math.h: 100 redefinition of '_stdcall'
Error cos.c: c:\lcc\include\math.h: 99 Previous definition of '_stdcall' here
Error cos.c: c:\lcc\include\math.h: 100 Syntax error; missing semicolon before `fabsd'
Warning cos.c: c:\lcc\include\math.h: 100 no type specified. Defaulting to int
Error cos.c: c:\lcc\include\math.h: 101 redefinition of '_stdcall'
Error cos.c: c:\lcc\include\math.h: 100 Previous definition of '_stdcall' here
Error cos.c: c:\lcc\include\math.h: 101 Syntax error; missing semicolon before `fabsf'
Warning cos.c: c:\lcc\include\math.h: 101 no type specified. Defaulting to int
Error cos.c: c:\lcc\include\math.h: 103 redefinition of '_stdcall'
Error cos.c: c:\lcc\include\math.h: 101 Previous definition of '_stdcall' here
Error cos.c: c:\lcc\include\math.h: 103 Syntax error; missing semicolon before `_fabsi'
Warning cos.c: c:\lcc\include\math.h: 103 no type specified. Defaulting to int
Error cos.c: c:\lcc\include\math.h: 104 Syntax error; missing semicolon before `_fabsull'
Warning cos.c: c:\lcc\include\math.h: 104 no type specified. Defaulting to int
Error cos.c: c:\lcc\include\math.h: 105 Syntax error; missing semicolon before `_fabsll'
Warning cos.c: c:\lcc\include\math.h: 105 no type specified. Defaulting to int
Error cos.c: c:\lcc\include\math.h: 106 Syntax error; missing semicolon before `_fabsu'
Warning cos.c: c:\lcc\include\math.h: 106 no type specified. Defaulting to int
Error cos.c: c:\lcc\include\math.h: 272 redefinition of '_stdcall'
Error cos.c: c:\lcc\include\math.h: 106 Previous definition of '_stdcall' here
Error cos.c: c:\lcc\include\math.h: 272 Syntax error; missing semicolon before `_signbit'
Warning cos.c: c:\lcc\include\math.h: 272 no type specified. Defaulting to int
Error cos.c: c:\lcc\include\math.h: 346 redefinition of '_stdcall'
Error cos.c: c:\lcc\include\math.h: 272 Previous definition of '_stdcall' here
Error cos.c: c:\lcc\include\math.h: 346 Syntax error; missing semicolon before `_rint'
Warning cos.c: c:\lcc\include\math.h: 346 no type specified. Defaulting to int
Error cos.c: c:\lcc\include\tgmath.h: 30 too many errors

Is better not use -pedantic? People say -pedantic is good.


.



Relevant Pages

  • Re: new order doubt
    ... Warning test2.c: 8  no type specified. ... Defaulting to int ... "signed short" is obviously better since the compiler ...
    (comp.lang.c)
  • New to C programming. Signed up for a class at Junior college
    ... LCC compiles the above with no problem. ... the compiler shows a warning. ... I thought %d is for int, ...
    (comp.compilers.lcc)
  • new order doubt
    ... Warning test2.c: 8 no type specified. ... Defaulting to int ... Code print ...
    (comp.lang.c)
  • Re: new order doubt
    ... Warning test2.c: 8 no type specified. ... Defaulting to int ... Code print ...
    (comp.lang.c)
  • xemacs installation problems
    ... checking for gcc... ... checking whether we are using GNU C... ... checking size of int... ... configure: warning: No OffiX without generic Drag'n'Drop support ...
    (comp.os.linux.misc)