Community
cancel
Showing results for 
Search instead for 
Did you mean: 
dajum
Novice
386 Views

USE ADVAPI32 functions in openAPI compiler

I have code that works fine in the last few version of the compiler.  Using Intel(R) Fortran Intel(R) 64 Compiler Classic for applications running on Intel(R) 64, Version 2021.1 Build 20201112_000000

I get an error #5528: The REFERENCE attribute cannot be used with a passed length CHARACTER variable on this platform

Since I have USE ADVAPI32 that is where I expect the definitions to be found.  How do I work around this error?

Code looks like (with lots removed for clarity):


INTEGER TYPEK,I,NV,STATUS,REG,ILEN
CHARACTER*512 PATH,VALUE,KEY
REG = 0
TYPEK = 0
VALUE = ' '
Path = 'Software\OurKey\OurCODE\1.1' // CHAR(0)
I = RegOpenKeyEx(HKEY_LOCAL_MACHINE, PATH, 0, KEY_READ, LOC(REG))

0 Kudos
12 Replies
dajum
Novice
361 Views

Attaching a test program that fails using IFX.

IFX @Test.txt

is how I compiled it but you can just use IFX test.for as well to get the message.

andrew_4619
Valued Contributor III
353 Views

If the Interface used by IFX is the same as the Classic compiler (please check that) then I would expect your code to work. One problem is those interfaces are as old as the hills an use all manner of cludgy extensions "ignore loc" , "allow null" but if intel updated them to work with modern fortran c interop then existing code would break. I would file a report on it, I think the error is an error. I use my own interface for the routine.

Steve_Lionel
Black Belt Retired Employee
344 Views

Your test program compiles and runs fine with ifort, which you said you used in the original post. I agree it fails with ifx, which is a beta compiler, and that's a bug, or more likely, a not-yet-implemented thing.

 
Barbara_P_Intel
Moderator
326 Views

I may be way off base on this, but that "32" is jumping out at me.  Are those 32 -bit functions?  

ifx supports only 64-bit targets.  

And for planning purposes according to the Fortran Release Notes under Support Deprecated

  • Support for 32-bit targets is deprecated in ifort and will be removed in a future release.

 

Steve_Lionel
Black Belt Retired Employee
318 Views

No, they are not 32-bit-only functions. The "32" in the name is an artifact. These functions are provided by advapi32.dll, a Windows system DLL.

dajum
Novice
290 Views

Certainly the module ADVAPI32 is a Intel creation.  A bug in the IFX implementation for sure. 

Steve_Lionel
Black Belt Retired Employee
277 Views

There's nothing wrong with the module (originated with Microsoft). It's a simple ifx bug.

 
dajum
Novice
262 Views

Question is how long do we have to wait for a fix? Maybe someone could post the fix?

mecej4
Black Belt
256 Views

BarbaraP wrote: "I may be way off base on this, but that "32" is jumping out at me."

We are dealing with a well-known anomaly of Windows. On a 64-bit Windows system, the System32 directory contains 64-bit EXEs and DLLs, whereas the SysWOW64 directory contains 32-bit EXEs and DLLs. The modifier "32" was added to system file names when DOS/Windows made the transition from 16 bit to 32 bit in the 1990s.

Steve_Lionel
Black Belt Retired Employee
244 Views

@dajum , just use ifort and not ifx. 

 
Barbara_P_Intel
Moderator
243 Views

Thanks for the information about that "32".  I learned a bit more about Windows.  I'm more of a Linux person. 

Barbara_P_Intel
Moderator
199 Views

This is the error I get

>ifx test.for
Intel(R) Fortran Compiler for applications running on Intel(R) 64, Version 2021.1.2 Beta Build 20201214
Copyright (C) 1985-2020 Intel Corporation. All rights reserved.

test.for(11): error #5528: The REFERENCE attribute cannot be used with a passed length CHARACTER variable on this platform
                I = RegOpenKeyEx(HKEY_LOCAL_MACHINE, PATH, 0, KEY_READ, LOC(REG))
----------------^
compilation aborted for test.for (code 1)

ifx does not yet recognize non-standard C-interoperability.  This error has already been reported, CMPLRLLVM-25905. 

I added your nice reproducer to the case. Thank you for that!

As Steve pointed out, it works just fine with ifort.  You can mix and match .obj files from ifort and ifx.

 

Reply