• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: GCC for i386 allows 'invalid suffix "f" on integer constant'
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: GCC for i386 allows 'invalid suffix "f" on integer constant'


  • Subject: Re: GCC for i386 allows 'invalid suffix "f" on integer constant'
  • From: Dirk Stegemann <email@hidden>
  • Date: Sat, 21 Jan 2006 00:16:07 +0200

Hello,

Am 20.01.2006 um 23:24 schrieb Chris Espinosa:

'2' is an integer literal, and only combinations of [ulUL] are allowed for integer literals. '2' is an invalid floating literal, as it has neither a fraction part nor an exponent. It cannot be typed as a float with "F" because it is not a floating literal.

Use 2.F or 2.0F instead.

You're right, and those variants work fine.
But the problem isn't that {float f = 2f;} compiles or doesn't compile, but that it behaves differently dependent on the -arch flag.


Our tools have to respond to other developers' C++ code, and it would be somewhat painful if we'd have to take different codepaths dependent on the architecture they want to compile their code for.
Fortunately, this issue isn't very likely to become a real-world problem, because view developers would write such code in the first place in case they want to support PPC architecture as well...



gcc is incorrect in failing to report the error when compiling with -arch i386, as the program is ill-formed according to the C standard.

That's what I guessed, thanks for the confirmation. So I'll file a bug report.


Regards, Dirk Stegemann


_______________________________________________ Do not post admin requests to the list. They will be ignored. Xcode-users mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
  • Follow-Ups:
    • Re: GCC for i386 allows 'invalid suffix "f" on integer constant'
      • From: Eric Albert <email@hidden>
References: 
 >GCC for i386 allows 'invalid suffix "f" on integer constant' (From: Dirk Stegemann <email@hidden>)
 >Re: GCC for i386 allows 'invalid suffix "f" on integer constant' (From: Eric Albert <email@hidden>)
 >Re: GCC for i386 allows 'invalid suffix "f" on integer constant' (From: Dirk Stegemann <email@hidden>)
 >Re: GCC for i386 allows 'invalid suffix "f" on integer constant' (From: Eric Albert <email@hidden>)
 >Re: GCC for i386 allows 'invalid suffix "f" on integer constant' (From: Dirk Stegemann <email@hidden>)
 >Re: GCC for i386 allows 'invalid suffix "f" on integer constant' (From: Dirk Stegemann <email@hidden>)
 >Re: GCC for i386 allows 'invalid suffix "f" on integer constant' (From: Chris Espinosa <email@hidden>)

  • Prev by Date: Re: Set Carbon or Cocoa Project to use C++
  • Next by Date: Re: deprecated FOUR_CHAR_CODE and macintel
  • Previous by thread: Re: GCC for i386 allows 'invalid suffix "f" on integer constant'
  • Next by thread: Re: GCC for i386 allows 'invalid suffix "f" on integer constant'
  • Index(es):
    • Date
    • Thread