Archived

This forum has been archived. Please start a new discussion on GitHub.

icecpp and relative paths

Hi. Should

icecpp.exe ..\foo.ice

work as expected on Windows?

In cccp.c::base_name, the backslash is not detected as a path separator, which ultimately causes preprocessing of one of my files to fail. I recompiled icecpp.exe with DIR_SEPARATOR defined to '\\' and things worked as expected. This was manifested when foo.ice contained a relative path #include.

Thanks,
Craig

Comments

  • marc
    marc Florida
    Our Slice compilers (slice2cpp, slice2java, etc.) translate all backslashes to forward slashes before they call icecpp. You should not call icecpp directly.

    Note that icecpp is simply the GNU C preprocessor. It is included in the Ice distribution for convenience.
  • Hmmm. Well slice2py doesn't seem to be. I'll look into that further. I wasn't calling icecpp directly, but I ended up there tracing the problem.
  • marc
    marc Florida
    I forgot to mention: In Slice files, you must use the forward slash for #include statements. Backslashes in Slice #include statements do not work. (I guess our documentation has to be modified to point this out.)

    However, for pathnames passed to slice2xxx, both forward and backslashes should work. Backslashes are then translated to forward slashes before such paths are passed to icecpp.
  • I actually am using / in the include statement. I just stepped through the Ice-3.2.1 slice2py.exe::main function and there doesn't appear to be any \ -> / translation. In any case, icecpp is definitely being passed a \
  • marc
    marc Florida
    Seems to be a bug then... thanks for the report!