• 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: Tue, 14 Mar 2006 01:09:27 +0200

Hi,

Am 13.03.2006 um 22:29 schrieb Wim Lewis:

Interestingly, you get *different* incorrect results depending on whether -mdynamic-no-pic is specified (in addition to the necessary -fasm-blocks). If you specify -Wall, then gcc complains that you haven't initialized 'f' --- so it's clearly interpreting the line "float f = 2F;" in some unexpected way.

% gcc-4.0 -x c -arch i386 -pipe -fasm-blocks -Os -Wall -mdynamic- no-pic -S t.c
t.c: In function ‘spork’:
t.c:6: warning: ‘f’ is used uninitialized in this function
% cat t.c


float spork (void) {
        float f = 2F;
        return f;
}

I already filed a different bug related to the '-fasm-blocks' flag, which is revealed on i386 only. It is about initialising a float variable using an integer constant (as also used in your code):


<rdar://4417221>

Try this one:

% echo "int main (int argc, char * const argv[]) {float f = 2f;return 0;}" > test.c
% /usr/bin/gcc-4.0 -arch i386 -fasm-blocks -c test.c


GCC *doesn't* complain about this code, although it should.
At runtime, variable 'f' is initialised using arbitrary data, as it seems.


Maybe you should file a bug report as well, thoses issues seem to be related.
My bug is still marked 'open'...



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


References: 
 >Re: GCC for i386 allows 'invalid suffix "f" on integer constant' (From: Wim Lewis <email@hidden>)

  • Prev by Date: Re: "Open Quickly" help!
  • Next by Date: Re: "Open Quickly" help!
  • Previous by thread: Re: GCC for i386 allows 'invalid suffix "f" on integer constant'
  • Next by thread: Shared Framework FRAMEWORK_SEARCH_PATHS issue
  • Index(es):
    • Date
    • Thread