- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ifort (11.0.083) compiles without error if I have a mixed relational expression of the form,
if ('abc'==5) then...
how does ifort treat such expressions? i could not find any discussion in the documentation. should this raise an error?
if ('abc'==5) then...
how does ifort treat such expressions? i could not find any discussion in the documentation. should this raise an error?
1 Solution
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It's historical. For character literals 4 characters or less they are treated as if they were Hollerith constants (e.g. 3Habc), which are integers.
Link Copied
4 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quoting - tracyx
ifort (11.0.083) compiles without error if I have a mixed relational expression of the form,
if ('abc'==5) then...
how does ifort treat such expressions? i could not find any discussion in the documentation. should this raise an error?
if ('abc'==5) then...
how does ifort treat such expressions? i could not find any discussion in the documentation. should this raise an error?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quoting - tim18
Apparently, 'abc'==5 is evaluated to .false. at compile time. If you set -stand, you get the mandatory warning according to standard (at least in current versions). This is a weird extension, not supported by many other compilers.
Thank you for your reply. I had some code which had an expression like this (in error), and only spotted it when I ran it through g95.
This seems a bizarre (and potentially dangerous) extension. Apparently 'abc'>5 is true for some reason.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It's historical. For character literals 4 characters or less they are treated as if they were Hollerith constants (e.g. 3Habc), which are integers.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quoting - Steve Lionel (Intel)
It's historical. For character literals 4 characters or less they are treated as if they were Hollerith constants (e.g. 3Habc), which are integers.

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page