CXX on X86 : not the correct .h file is included

Post Reply

Topic author
joukj
Master
Posts: 184
Joined: Thu Aug 27, 2020 5:50 am
Reputation: 0
Status: Offline

CXX on X86 : not the correct .h file is included

Post by joukj » Fri Jul 28, 2023 5:47 am

Hi all

Since I installed CXX A10.0-230718, I get problems with packages which have their own types.h. It seems thqat CXX refuses to inlude it (see example below). This did not occur in the previous version of CXX.

In the example below the two compilations both should give an error the line "erroerror" in the .h file, but only one of them does, the other does not include it. (I also tested this with more useful content of types.h)

Code: Select all

rumba-jj) cxx/vers
clang version 10.0.1 (git@bitbucket.org:vms_software/llvm-10.0.1.git 1a6bcdeb1db
d320d5898ab7723bb691325ce8bd5)
Build date: 07-18-2023
Target: x86_64-OpenVMS
Thread model: posix
InstalledDir: RUMBA$DKA100:[SYS0.SYSCOMMON.][SYSEXE]
rumba-jj) dir [...]

Directory SYS$SYSDEVICE:[JOUKJ.test.bugs.cxx.types.src]

dec.DIR;1           webp.DIR;1          

Total of 2 files.

Directory SYS$SYSDEVICE:[JOUKJ.test.bugs.cxx.types.src.dec]

a2.c;1              alpha_dec.c;26      

Total of 2 files.

Directory SYS$SYSDEVICE:[JOUKJ.test.bugs.cxx.types.src.webp]

TTT.H;1             TYPES.H;19          

Total of 2 files.

Grand total of 5 directories, 9 files.
runba-jj) ty [.dec]a2.c
#include "src/webp/ttt.h"
rumba-jj) ty [.dec]alpha_dec.c
#include "src/webp/types.h"
rumba-jj) ty [.webp]types.h

errorerror

rumba-jj) ty [.webp]ttt.h  

errorerror

rumba-jj) set def [.dec]
rumba-jj) define src []
rumba-jj) cxx alpha_dec.c
rumba-jj) cxx a2.c      
n file included from SYS$SYSDEVICE:[JOUKJ.test.bugs.cxx.types.src.dec]a2.c;1:1:
/src/webp/ttt.h:2:1: error: unknown type name 'errorerror'
errorerror
^
SYS$SYSDEVICE:[JOUKJ.test.bugs.cxx.types.src.dec]a2.c;1:1:26: error: expected un
qualified-id
#include "src/webp/ttt.h"
                         ^
2 errors generated.


I have no idea if another types,.h (which??:) is included here.
Note that many opensource packages depend on their own types.h

Jouk

User avatar

martinv
Master
Posts: 104
Joined: Fri Jun 14, 2019 11:05 pm
Reputation: 0
Location: Goslar, Germany
Status: Offline
Contact:

Re: CXX on X86 : not the correct .h file is included

Post by martinv » Fri Jul 28, 2023 6:49 am

I have no idea if another types,.h (which??:) is included here.
Probably the system include, either from SYS$COMMON:[DECC$LIB.REFERENCE.DECC$RTLDEF]TYPES.H, or - in A10.0-20230718 of the compiler - from the TYPES module in SYS$LIBRARY:DECC$RTLDEF.TLB
Note that many opensource packages depend on their own types.h
Quote from the system's TYPES.H: "Header introduced by the ISO POSIX-1 Standard".

So it's all about the search order of include files. However, a relative path in the #include should be clear. Did you try to /INCLUDE=[] ?
There is something wrong with everything that is popular.
(Charles Fort)


Topic author
joukj
Master
Posts: 184
Joined: Thu Aug 27, 2020 5:50 am
Reputation: 0
Status: Offline

Re: CXX on X86 : not the correct .h file is included

Post by joukj » Fri Jul 28, 2023 7:47 am

A /include=[] will not help here since the path is explicitly given in the #include "src/webp/types.h"

I realised I also got the prolem with the /include qualifier in another project

Presently I reverted back to the previous compiler.
Last edited by joukj on Fri Jul 28, 2023 8:14 am, edited 1 time in total.


Topic author
joukj
Master
Posts: 184
Joined: Thu Aug 27, 2020 5:50 am
Reputation: 0
Status: Offline

Re: CXX on X86 : not the correct .h file is included

Post by joukj » Mon Sep 04, 2023 7:29 am

Looks like solved i n new compiler.

Post Reply