[omniORB] omniidl bug

Serguei Kolos Serguei.Kolos at cern.ch
Fri Mar 26 15:29:46 GMT 2004


Hello Duncan

You are right. I have managed to achieve the desired behavior by
hacking the preprocessor code in the following way:
1. when the preprocessor encounter an included file it tries to open it
    and if it was successful it remembers the full file name.
2. I added one line of code, which makes it remembering the original (short)
    file name instead of the full one.
As a result the original (short) file name appears in the preprocessor 
output.
I believe the omniidl itself does not try to open the included files and 
everything
works as I desired. I believe this would not have any negative 
implications to the
IDL compiler. What do you think ?

Below there is a patch:

*** src/tool/omniidl/cxx/cccp/cccp.c    Tue Jul  4 17:22:38 2000
--- 
../working/online/omni/omni-05-00-00/src/tool/omniidl/cxx/cccp/cccp.c       
Fri Mar 26 15:20:50 2004
***************
*** 4490,4495 ****
--- 4490,4496 ----
  #endif /* VMS */
        f = open_include_file (fname, searchptr, importing, &inc);
        if (f != -1) {
+       strcpy (fname, fbeg);
        if (bypass_slot && searchptr != first_bracket_include) {
          /* This is the first time we found this include file,
             and we found it after first_bracket_include.


Duncan Grisby wrote:

>On Friday 19 March, Serguei Kolos wrote:
>
>  
>
>>1. file Test.idl contains the line:
>>
>>   #include <mydir/myidl.idl>
>>
>>2. myidl.idl file is in the /home/myincludes/mydir directory
>>
>>3. I'm executing the following command:
>>
>>   > omniidl -bcxx -Wbkeep_inc_path -I/home/myincludes TT.idl
>>
>>4. and finally the generated TT.hh file contains the following statement:
>>
>>#ifndef __myidl_hh_EXTERNAL_GUARD__
>>#define __myidl_hh_EXTERNAL_GUARD__
>>#include </home/myincludes/mydir/myidl.hh>
>>#endif
>>
>>5. I would expect to have here the following:
>>#ifndef __myidl_hh_EXTERNAL_GUARD__
>>#define __myidl_hh_EXTERNAL_GUARD__
>>#include <mydir/myidl.hh>
>>#endif
>>    
>>
>
>People have mentioned this before. I agree that it would be useful if
>it behaved the way you suggest. Unfortunately, omniidl never gets to
>see the original #include <mydir/myidl.idl> since it is handled by the
>C pre-processor. By the time omniidl sees it, the directive output by
>the pre-processor has the full file path. There's no easy way for
>omniidl to figure out what it was originally.
>
>Cheers,
>
>Duncan.
>
>  
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.omniorb-support.com/pipermail/omniorb-list/attachments/20040326/88a5fbdd/attachment-0001.htm


More information about the omniORB-list mailing list