Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#200 ant-cc task doesn't fully support msvc8 without warnings

closed-fixed
David Haney
cpptasks (103)
5
2007-08-22
2007-03-29
Anonymous
No

my email: mike dot micucci at roguewave dot com

We use the ant-cc task to compile sources on many different platforms, including MSVC 8.0 (Visual Studio 2005). The /GX flag was fixed to use /EHsc in the latest version, but the /GZ flag is still used when debug mode is turned on. This will cause the following warning on VC8:

[cc] 1 total files to be compiled.
[cc] cl /EHsc /c /nologo /Zi /Od /GZ /D_DEBUG /MDd /GR MyFile.cpp
Execute:Java13CommandLauncher: Executing 'cl' with arguments:
'/EHsc'
'/c'
'/nologo'
'/Zi'
'/Od'
'/GZ'
'/D_DEBUG'
'/MDd'
'/GR'
'MyFile.cpp'

The ' characters around the executable and arguments are
not part of the command.
[cc] cl : Command line warning D9035 : option 'GZ' has been deprecated and will be removed in a future release
[cc] cl : Command line warning D9036 : use 'RTC1' instead of 'GZ'

These warnings can be problematic for users who wish 100% clean builds (no warnings). We also can't work around this because the MSVC compiler def automatically sets the /MD or /MDd flags based on the debug flag passed in, so we can't hardcode that to "false" and then just add the correct debug flags, because we'll get the incorrect MSVCRT lib linked in.

The /RTC1 and the /RTCs flags are available on VC7.1, so it may be possible to just use those, although it'd be really cool to get a msvc8 compiler definition in addition to the regular msvc definition, which has all the compatibile flags for vc8.

Thanks!

--Michael Micucci
--Roguewave Software

Discussion

  • Curt Arnold
    Curt Arnold
    2007-03-29

    Logged In: YES
    user_id=27193
    Originator: NO

    It is a bit problematic since VC6 doesn't support /RTC1. Either the compiler version needs to be sniffed or a distinct compiler enum needs to distinguish between VC6 and VC8 to avoid the warning. Likely the best is to add a new enum for "msvc8".

     
  • Logged In: NO

    Michael Micucci - micucci at roguewave dot com

    I agree that using a "msvc8" enum value is a good solution as well.

    Thanks!

    -- Michael Micucci
    -- Senior Software Developer - Roguewave Software

     
  • David Haney
    David Haney
    2007-08-17

    Logged In: YES
    user_id=1140024
    Originator: NO

    I've uploaded a patch to address this issue (1776565).

    The patch modifiers the existing msvc definition so that the debug flags are added via a member method, and adds a derived msvc8 definition that overrides the member method to use the /RTC1 value instead of /GZ. There are also additional unit tests to verify that the correct value is returned for each compiler definition.

     
  • David Haney
    David Haney
    2007-08-22

    Logged In: YES
    user_id=1140024
    Originator: NO

    Committed patch 1776565 in svn revision 138.

     
  • David Haney
    David Haney
    2007-08-22

    • assigned_to: carnold --> darius42
    • status: open --> closed-fixed