I finally found out why MSVC refuses to compile planet.c

I finally found out why MSVC refuses to compile planet.c

Return to topic list

Sun Jun 25 12:07:15 2023   by   Mizuki
It seems the program is intended to be super-backward compatible, and trying to compile the program with modern msys2 clang finally reveals why MSVC doesn't want to compile the program.

planet.c:251:5: warning: a function definition without a prototype is deprecated in all versions of
      C and is not supported in C2x [-Wdeprecated-non-prototype]
int min(x,y)
    ^
planet.c:255:5: warning: a function definition without a prototype is deprecated in all versions of
      C and is not supported in C2x [-Wdeprecated-non-prototype]
int max(x,y)
    ^
planet.c:259:8: warning: a function definition without a prototype is deprecated in all versions of
      C and is not supported in C2x [-Wdeprecated-non-prototype]
double fmin(x,y)
      ^
planet.c:263:8: warning: a function definition without a prototype is deprecated in all versions of
      C and is not supported in C2x [-Wdeprecated-non-prototype]
double fmax(x,y)
      ^
planet.c:321:3: error: call to undeclared function 'setmode'; ISO C99 and later do not support
      implicit function declarations [-Wimplicit-function-declaration]
  setmode(fileno(outfile), OBINARY);

These "a function definition without a prototype" error pops out all over the code.
 
Sun Jun 25 12:26:54 2023   by   Mizuki
here's the full error log if you want
https://pastes.io/xegw5g6ymv
 
Mon Jun 26 09:52:36 2023   by   Torben
Large parts of the code was written in the 1980s, using old-style declarations.  I have only changed what was required by GCC, so it is no surprise that more strict compilers will complain.  But thanks for the report, I will look at it when I have more time (busy with exams right now).
 

Return to topic list



New message:
Topic:
Posted by:

Type the values of the dice shown below:

Return to topic list