Syntax error: variable is static *and* extern

GLtron
2007-01-27
2012-09-15
  • Nick Urbanik
    Nick Urbanik
    2007-01-27

    Dear Andreas and team,

    there is a syntax error in src/include/game/ai.h: there, we have an extern statement, exporting a variable ai_params:
    extern AI_Parameters ai_params;
    whereas in src/game/computer.c, which includes src/include/game/ai.h, we have:
    static AI_Parameters ai_params = { ..... };
    which gcc 4.1.1 correctly picks up as an error, and will not continue.

    The solution is simple:

    remove the line
    extern AI_Parameters ai_params;
    completely from src/include/game/ai.h, since ai_params is not used anywhere else except in these two files. It will then compile with gcc 4.1.1

     
    • Andreas Umbach
      Andreas Umbach
      2007-01-27

      Thanks for pointing this out. The issue is known though, and the fix has been checked in for over a year - into the subversion repository at berlios.

      The CVS version on sourceforge is hopelessly out of date, it's only updated for 'stable' releases. Since sourceforge has added subversion support only 'recently', I have long ago moved the development tree to the subversion repository at berlios.de. Here's the GLtron project page:

      http://developer.berlios.de/projects/gltron/

      I just realized that I still list the CVS as authoritative source on http://www.gltron.org/developer.php, I'm going to update that. Sorry for the hassle...

      • Andreas