#4 Build failure of Parser.cpp on FreeBSD 5.0

closed-fixed
nobody
None
5
2003-06-11
2003-03-24
Anonymous
No

Parser.cpp fails to build on FreeBSD 5.0, giving three
errors:

Parser.cpp:646: invalid conversion from 'long int*' to
'const time_t*'
Parser.cpp:682: invalid conversion from 'long int*' to
'const time_t*'
Parser.cpp:820: invalid conversion from 'long int*' to
'const time_t*'

I fixed the problem by editing Parser.cpp, changing the
three mentions of:

std::ctime(&date);

to read:

std::ctime((const time_t*) &date);

The build then finished without a problem. I don't
know C++, so I'm not sure why this fixed the problem.
I saw the fix mentioned in conjunction with the error
on a web page somewhere :-)

Discussion

  • Morten Brix Pedersen

    Logged In: YES
    user_id=277268

    Thanks for noticing this to me. Can you check whether this
    line will also compile (an alternative fix)?

    std::ctime(reinterpret_cast<const time_t*>(&date));

     
  • Morten Brix Pedersen

    • status: open --> open-fixed
     
  • Nobody/Anonymous

    Logged In: NO

    The problem still exists in 0.2.6 - one of the instances was
    changed to the reinterpret_cast call, but the other two
    still make the compile barf. FWIW, changing the two
    remaining instances to use reinterpret_cast as described
    fixed the problem for me on FBSD 5.0 with 0.2.6.

     
  • Morten Brix Pedersen

    Logged In: YES
    user_id=277268

    Can you be more exact? What exactly did you change? A
    small unified diff would be great. I don't have a FreeBSD 5.0
    machine to test on.

     
  • Morten Brix Pedersen

    Logged In: YES
    user_id=277268

    Fixed in CVS.

     
  • Morten Brix Pedersen

    • status: open-fixed --> closed-fixed
     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks