public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/50046] New: Hexidecimal Constants
@ 2011-08-11 17:12 James.W.Burgess at aero dot org
  2011-08-11 17:25 ` [Bug fortran/50046] " kargl at gcc dot gnu.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: James.W.Burgess at aero dot org @ 2011-08-11 17:12 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50046

             Bug #: 50046
           Summary: Hexidecimal Constants
    Classification: Unclassified
           Product: gcc
           Version: 4.3.4
            Status: UNCONFIRMED
          Severity: minor
          Priority: P3
         Component: fortran
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: James.W.Burgess@aero.org


When rehosting a utility to a different computer, the compiler would treat
hexidecimal constants as a string (8 bits per character).  To fix this in my
code I translated the hexidecimal constants to integers.

Here is an example:

'FFFF0000'X  had be changed to -65536 to successfully compile.

The compiler should be able to handle using hexidecimal constants.


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug fortran/50046] Hexidecimal Constants
  2011-08-11 17:12 [Bug fortran/50046] New: Hexidecimal Constants James.W.Burgess at aero dot org
@ 2011-08-11 17:25 ` kargl at gcc dot gnu.org
  2011-08-11 19:58 ` [Bug fortran/50046] Hexadecimal Constants mikael at gcc dot gnu.org
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: kargl at gcc dot gnu.org @ 2011-08-11 17:25 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50046

kargl at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |kargl at gcc dot gnu.org

--- Comment #1 from kargl at gcc dot gnu.org 2011-08-11 17:24:44 UTC ---
Please include a short example that demonstrates the problem.


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug fortran/50046] Hexadecimal Constants
  2011-08-11 17:12 [Bug fortran/50046] New: Hexidecimal Constants James.W.Burgess at aero dot org
  2011-08-11 17:25 ` [Bug fortran/50046] " kargl at gcc dot gnu.org
@ 2011-08-11 19:58 ` mikael at gcc dot gnu.org
  2011-08-11 20:19 ` sgk at troutmask dot apl.washington.edu
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: mikael at gcc dot gnu.org @ 2011-08-11 19:58 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50046

Mikael Morin <mikael at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |mikael at gcc dot gnu.org

--- Comment #2 from Mikael Morin <mikael at gcc dot gnu.org> 2011-08-11 19:57:39 UTC ---
Fortran 2008, 4.7:

R466 hex-constant is Z ’ hex-digit [ hex-digit ] ... ’
                     or Z " hex-digit [ hex-digit ] ... "


(In reply to comment #0)
> 'FFFF0000'X  had be changed to -65536 to successfully compile.
> 
According to the above, I'm afraid this is not the standard syntax.
Does it work with Z'FFFF0000'?

You didn't precise the working/failing compiler versions.
Or was the "working" version a non-GNU compiler?


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug fortran/50046] Hexadecimal Constants
  2011-08-11 17:12 [Bug fortran/50046] New: Hexidecimal Constants James.W.Burgess at aero dot org
  2011-08-11 17:25 ` [Bug fortran/50046] " kargl at gcc dot gnu.org
  2011-08-11 19:58 ` [Bug fortran/50046] Hexadecimal Constants mikael at gcc dot gnu.org
@ 2011-08-11 20:19 ` sgk at troutmask dot apl.washington.edu
  2011-08-13 11:05 ` mikael at gcc dot gnu.org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: sgk at troutmask dot apl.washington.edu @ 2011-08-11 20:19 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50046

--- Comment #3 from Steve Kargl <sgk at troutmask dot apl.washington.edu> 2011-08-11 20:18:29 UTC ---
On Thu, Aug 11, 2011 at 07:57:39PM +0000, mikael at gcc dot gnu.org wrote:
> 
> (In reply to comment #0)
> > 'FFFF0000'X  had be changed to -65536 to successfully compile.
> > 
> According to the above, I'm afraid this is not the standard syntax.
> Does it work with Z'FFFF0000'?

The 'X' postfix notation is an extension due to g77 compatiability.


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug fortran/50046] Hexadecimal Constants
  2011-08-11 17:12 [Bug fortran/50046] New: Hexidecimal Constants James.W.Burgess at aero dot org
                   ` (2 preceding siblings ...)
  2011-08-11 20:19 ` sgk at troutmask dot apl.washington.edu
@ 2011-08-13 11:05 ` mikael at gcc dot gnu.org
  2011-08-20 14:58 ` mikael at gcc dot gnu.org
  2011-11-07 22:54 ` fxcoudert at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: mikael at gcc dot gnu.org @ 2011-08-13 11:05 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50046

--- Comment #4 from Mikael Morin <mikael at gcc dot gnu.org> 2011-08-13 10:11:47 UTC ---
This is accepted by gfortran trunk (4.7):

      integer(8) :: i = 'FFFF0000'X
      end

Please provide a small self-contained test case demonstrating the problem.
Also precise the compiler version and the command line used. 
Otherwise, we will close this bug.

PS: see http://gcc.gnu.org/bugs/ for bug reporting tips.


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug fortran/50046] Hexadecimal Constants
  2011-08-11 17:12 [Bug fortran/50046] New: Hexidecimal Constants James.W.Burgess at aero dot org
                   ` (3 preceding siblings ...)
  2011-08-13 11:05 ` mikael at gcc dot gnu.org
@ 2011-08-20 14:58 ` mikael at gcc dot gnu.org
  2011-11-07 22:54 ` fxcoudert at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: mikael at gcc dot gnu.org @ 2011-08-20 14:58 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50046

Mikael Morin <mikael at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |WAITING
   Last reconfirmed|                            |2011-08-20
     Ever Confirmed|0                           |1

--- Comment #5 from Mikael Morin <mikael at gcc dot gnu.org> 2011-08-20 14:54:53 UTC ---
Waiting for feedback...


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug fortran/50046] Hexadecimal Constants
  2011-08-11 17:12 [Bug fortran/50046] New: Hexidecimal Constants James.W.Burgess at aero dot org
                   ` (4 preceding siblings ...)
  2011-08-20 14:58 ` mikael at gcc dot gnu.org
@ 2011-11-07 22:54 ` fxcoudert at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: fxcoudert at gcc dot gnu.org @ 2011-11-07 22:54 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50046

Francois-Xavier Coudert <fxcoudert at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|WAITING                     |RESOLVED
                 CC|                            |fxcoudert at gcc dot
                   |                            |gnu.org
         Resolution|                            |WORKSFORME

--- Comment #6 from Francois-Xavier Coudert <fxcoudert at gcc dot gnu.org> 2011-11-07 22:50:06 UTC ---
Same comment as Mikael here, hex constants following the GNU extension work
fine with recent gfortran versions. Thus closing this report. If you still
encounter this problem, please reopen with a self-contained example and
information on what compiler you are using


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2011-11-07 22:53 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-08-11 17:12 [Bug fortran/50046] New: Hexidecimal Constants James.W.Burgess at aero dot org
2011-08-11 17:25 ` [Bug fortran/50046] " kargl at gcc dot gnu.org
2011-08-11 19:58 ` [Bug fortran/50046] Hexadecimal Constants mikael at gcc dot gnu.org
2011-08-11 20:19 ` sgk at troutmask dot apl.washington.edu
2011-08-13 11:05 ` mikael at gcc dot gnu.org
2011-08-20 14:58 ` mikael at gcc dot gnu.org
2011-11-07 22:54 ` fxcoudert at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).