#273 Differing exceptions in getopt declaration

trunk
closed-fixed
G Biggs
player (137)
5
2009-04-03
2009-03-27
Oliver Coleman
No

[ 57%] Building CXX object server/libplayerdrivers/CMakeFiles/playerdrivers.dir/__/drivers/mixed/erratic/motorpacket.o
In file included from /usr/include/unistd.h:849,
from /home/data/ml/unsw/comp4411/player-trunk/server/drivers/mixed/erratic/motorpacket.cc:29:
/usr/include/getopt.h:153: error: declaration of ‘int getopt(int, char* const*, const char*) throw ()’ throws different exceptions
/home/data/ml/unsw/comp4411/player-trunk/replace/replace.h:141: error: from previous declaration ‘int getopt(int, char* const*, const char*)’
make[2]: *** [server/libplayerdrivers/CMakeFiles/playerdrivers.dir/__/drivers/mixed/erratic/motorpacket.o] Error 1
make[1]: *** [server/libplayerdrivers/CMakeFiles/playerdrivers.dir/all] Error 2
make: *** [all] Error 2

I replaced
int getopt (int argc, char * const argv[], const char *optstring);
with
int getopt (int argc, char * const argv[], const char *optstring) __THROW;
in replace/replace.h

and replaced
int getopt (int argc, char * const argv[], const char *optstring)
with
int getopt (int argc, char * const argv[], const char *optstring) throws()
in replace/getopt.c

and it seemed to compile okay...

Using Ubuntu Jaunty 9.04

Discussion

  • G Biggs
    G Biggs
    2009-03-30

    This is indirectly caused by the build system not finding getopt on your system (even though it's clearly there), and so trying to use the local version from /replace/. We need to figure out why it's not finding getopt and fix that. Have a look in build/CMakeFiles/CMakeError.log for getopt and paste the error it gives when it does the search for it.

     
  • G Biggs
    G Biggs
    2009-03-30

    • assigned_to: gerkey --> gbiggs
     
  • G Biggs
    G Biggs
    2009-04-03

    Fixed in CVS HEAD. Thanks very much for the report.

     
  • G Biggs
    G Biggs
    2009-04-03

    You're in luck. My system upgraded to gcc 4.3 recently and started triggering this error. I've tracked down the cause and fixed it.

     
  • G Biggs
    G Biggs
    2009-04-03

    • status: open --> closed-fixed