- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Is this code, standard-complying:
integer :: i = 1 if (i) Print *, "Hello World!" end
If not, why does Intel ifort happily compile and execute the code with no error? This seems too obvious to be a compiler bug. So, it is there likely for a reason. But this code does not compile with Gfortran.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
A. King wrote:Is there any plans to change this default behavior (for example, by allowing the compiler to keep the significant digits even when no kind is specified for the constant)?
There have been proposals to allow the default kind in a program unit (or other scoping unit) to be specified for the relevant intrinsic types.
But that aside, the implied proposal above is impractical. Depending on exactly what is being proposed there are multiple problems, but tos start consider the real literal `0.1` as an example in this alternative world - what kind is it?
I expect that a "physical chemist with background in [many things]" understood the limits of precision of floating point representation, so I suspect the underlying issue was simply that they thought that the default kind in Fortran was akin to double precision kind. There's no need to make literal resolution inscrutably opaque, confusing or incompatible in order to remedy that.
In terms of the issue with the large array constructor, Fortran has excellent support for "compile time" constant expression evaluation, which includes the ability to build up large arrays from smaller arrays, amongst many other things. I'd not expect issues with things like code bloat - compilers are pretty good at not including things in the executable that aren't required and/or loaders only load the pages from executables that are required.
Link Copied
- « Previous
-
- 1
- 2
- Next »
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Vautier, Gilles wrote:In a obj file, I think it's possible to set the memory block readonly.
You can also integrate a binary file in ressources. It may be readonly in this case.
Thanks again. Do you have any reference suggestions on how to it? I have never done this in the past.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
A. King wrote:Quote:
Vautier, Gilles wrote:
In a obj file, I think it's possible to set the memory block readonly.
You can also integrate a binary file in ressources. It may be readonly in this case.
Thanks again. Do you have any reference suggestions on how to it? I have never done this in the past.
For obj files, search for coff format but it's not easy to implement.
For ressources look here https://blog.kowalczyk.info/article/zy/Embedding-binary-resources-on-Windows.html

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- « Previous
-
- 1
- 2
- Next »