- Отметить как новое
- Закладка
- Подписаться
- Отключить
- Подписка на 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-канал
- Выделить
- Печать
- Сообщить о недопустимом содержимом
- Отметить как новое
- Закладка
- Подписаться
- Отключить
- Подписка на 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?

- Подписка на RSS-канал
- Отметить тему как новую
- Отметить тему как прочитанную
- Выполнить отслеживание данной Тема для текущего пользователя
- Закладка
- Подписаться
- Страница в формате печати