- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
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))
- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
The error reported here with ifx is fixed in the latest release, 2021.3.0. It was made available about a week ago. Please give it a try!
>ifx test.for
Intel(R) Fortran Compiler for applications running on Intel(R) 64, Version 2021.3.0 Beta Build 20210619
Copyright (C) 1985-2021 Intel Corporation. All rights reserved.
Microsoft (R) Incremental Linker Version 14.25.28612.0
Copyright (C) Microsoft Corporation. All rights reserved.
-out:test.exe
-subsystem:console
test.obj
>test.exe
daj out 2
Is the above the correct answer?
コピーされたリンク
- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
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.
- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
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.
- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
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.
- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
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.
- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
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.
- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
Certainly the module ADVAPI32 is a Intel creation. A bug in the IFX implementation for sure.
- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
There's nothing wrong with the module (originated with Microsoft). It's a simple ifx bug.
- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
Question is how long do we have to wait for a fix? Maybe someone could post the fix?
- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
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.
- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
Thanks for the information about that "32". I learned a bit more about Windows.
- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
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.
- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
The error reported here with ifx is fixed in the latest release, 2021.3.0. It was made available about a week ago. Please give it a try!
>ifx test.for
Intel(R) Fortran Compiler for applications running on Intel(R) 64, Version 2021.3.0 Beta Build 20210619
Copyright (C) 1985-2021 Intel Corporation. All rights reserved.
Microsoft (R) Incremental Linker Version 14.25.28612.0
Copyright (C) Microsoft Corporation. All rights reserved.
-out:test.exe
-subsystem:console
test.obj
>test.exe
daj out 2
Is the above the correct answer?