- Отметить как новое
- Закладка
- Подписаться
- Отключить
- Подписка на RSS-канал
- Выделить
- Печать
- Сообщить о недопустимом содержимом
Hi.
The latest IFX seems to allow initialization of INTEGER PARAMETERs with BOZ literals, but further usage does not interpret such parameters as INTEGERs.
The following code
use ISO_C_BINDING
implicit none
integer(C_INT), parameter :: IN_CLOSE_WRITE = z'00000008' !! Writtable file was closed
integer(C_INT), parameter :: IN_CLOSE_NOWRITE = z'00000010' !! Unwrittable file closed
integer(C_INT), parameter :: IN_CLOSE = ior(IN_CLOSE_WRITE, IN_CLOSE_NOWRITE) !! Close
end
Throws this error
$ ifx -V -stand f2023 -standard-semantics /media/vmshare/ior_boz.f90
Intel(R) Fortran Compiler for applications running on Intel(R) 64, Version 2025.0.1 Build 20241113
Copyright (C) 1985-2024 Intel Corporation. All rights reserved.
Intel(R) Fortran 25.0-1205.1
/media/vmshare/ior_boz.f90(5): error #8336: The arguments I and J must not both be boz-literal-constant. [IOR]
integer(C_INT), parameter :: IN_CLOSE = ior(IN_CLOSE_WRITE, IN_CLOSE_NOWRITE) !! Close
----------------------------------------^
compilation aborted for /media/vmshare/ior_boz.f90 (code 1)
debian@d
As I understand it, a BOZ literal is untyped, until assigned to an object with a specific type.
So my questions: is the code standard conforming but the feature is not ready yet in IFX? Or are INTEGER PARAMETERs supposed to propagate its "initialized-through-boz-literal" status?
- Отметить как новое
- Закладка
- Подписаться
- Отключить
- Подписка на RSS-канал
- Выделить
- Печать
- Сообщить о недопустимом содержимом
Ссылка скопирована
- Отметить как новое
- Закладка
- Подписаться
- Отключить
- Подписка на RSS-канал
- Выделить
- Печать
- Сообщить о недопустимом содержимом
The code is conforming to F2023, and BOZ status does not "propagate". You've declared the entities as INTEGER, so that's what they are. Intel Fortran has allowed using a BOZ constant to set the value of a PARAMETER for many, many years (as did DEC/Compaq Fortran before it.) This error message is puzzling to me.
- Отметить как новое
- Закладка
- Подписаться
- Отключить
- Подписка на RSS-канал
- Выделить
- Печать
- Сообщить о недопустимом содержимом
@Steve_Lionel wrote:Intel Fortran has allowed using a BOZ constant to set the value of a PARAMETER for many, many years...
Yes, I meant to say, "...without a warning when the -stand flag is given", which is the behavior I get with ifort.
Thanks for confirming the code is standard conforming, and that the error is an odd one.
- Отметить как новое
- Закладка
- Подписаться
- Отключить
- Подписка на RSS-канал
- Выделить
- Печать
- Сообщить о недопустимом содержимом
A bug report has been opened. We will fix it in the future product.
- Отметить как новое
- Закладка
- Подписаться
- Отключить
- Подписка на RSS-канал
- Выделить
- Печать
- Сообщить о недопустимом содержимом
This issue was fixed in version 2025.2.0
- Отметить как новое
- Закладка
- Подписаться
- Отключить
- Подписка на RSS-канал
- Выделить
- Печать
- Сообщить о недопустимом содержимом
Thanks for the notification, @Ron_Green .
This is a huge step in my attempt to migrate from ifort to ifx ---since I have like a million BOZ-literals that were never wrapped in INT(...) (I just suppresed the specific ifort warning).

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