ops2c.exe creates faulty header file when passed filename with backslashes / make fails #913

Closed
marks6i opened this Issue Jan 5, 2013 · 2 comments

Projects

None yet

2 participants

@marks6i
marks6i commented Jan 5, 2013

Building parrot using Win32/MSVC 2008 (Configure below) (n)make fails:

...
Compiled: ops2c.obj
link -out:ops2c.exe "ops2c.obj" "ops2c.RES" "E:/parrot\src\parrot_config.obj" "E:/parrot\libparrot.lib" -nologo -nodefaultlib -debug -machine:x86 kernel32.lib ws2_32.lib msvcrt.lib oldnames.lib advapi32.lib c:\usr\lib\icu\lib\icudt.lib c:\usr\lib\icu\lib\icuuc.lib
Creating library ops2c.lib and object ops2c.exp
mt.exe -nologo -manifest ops2c.exe.manifest -outputresource:ops2c.exe;1
Linked: ops2c.exe
.\ops2c.exe --dynamic src\dynoplibs\obscure.ops --quiet
cl -I.\include -I.\include\pmc -nologo -GF -W4 -MD -Zi -DNDEBUG -DWIN32 -D_CONSOLE -DNO_STRICT -DUSE_SITECUSTOMIZE -D_USE_32BIT_TIME_T -D_CRT_SECURE_NO_DEPRECATE -DHASATTRIBUTE_DEPRECATED -wd4101 -DHASATTRIBUTE_NORETURN -wd4101 -I "c:\usr\lib\icu\include" -Zi -wd4127 -wd4054 -wd4310 -Isrc\dynoplibs. -Fosrc\dynoplibs\obscure_ops.obj -c src\dynoplibs\obscure_ops.c
obscure_ops.c
e:\parrot\src\dynoplibs\obscure_ops.h(2) : warning C4067: unexpected tokens following preprocessor directive - expected a newline
e:\parrot\src\dynoplibs\obscure_ops.h(3) : error C2008: '' : unexpected in macro definition

obscure_ops.h looks like this:

ifndef PARROT_SRC\DYNOPLIBS\OBSCURE_OPS_H_GUARD

define PARROT_SRC\DYNOPLIBS\OBSCURE_OPS_H_GUARD

/* ex: set ro:

  • !!!!!!! DO NOT EDIT THIS FILE !!!!!!!
    *
  • This file is generated automatically from 'src\dynoplibs\obscure.ops' (and possibly other
  • .ops files). by ops2c.nqp.
    *
  • Any changes made here will be lost! To regenerate this file after making
  • changes to any ops, use the bootstrap-ops makefile target.
    *
    */
    ...

MSVC 2008 chokes on the backslashes in the file guard. Don't know if problem is that the full filename passed has backslashes in it or method _generate_guard_macro_name in compilers\opsc\src\Ops\Emitter.pm does not handle backslashes.

This was caused by rurban/win-replace_slashes-gh891 for #891

@rurban rurban was assigned Jan 5, 2013
@rurban
Member
rurban commented Jan 5, 2013

You said you had a fix also. Can you add your patch? I also patched it and I want to compare yours with with mine.

@rurban rurban added a commit that referenced this issue Jan 5, 2013
@rurban rurban [GH #913] Handle windows backslashes in ops2c h guard generator
rurban/win-replace_slashes-gh891 for #891 enabled windows paths, handle them in ops2c also.
Thanks to Mark Solinski. msvc tests passed.
6a6dc5e
@rurban
Member
rurban commented Jan 5, 2013

Fixed with 6a6dc5e

Thanks for the report! All tests pass (1 TODO in Parrot_IO 51, because of timezone issues).
Smoke report at http://smolder.parrot.org/app/projects/report_details/33748

@rurban rurban closed this Jan 5, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment