Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6788807
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T17:31:45+00:00 2026-05-26T17:31:45+00:00

I tested this expression in gdb: (gdb) p (int)[@-1 floatValue] $2 = 1 but

  • 0

I tested this expression in gdb:

(gdb) p (int)[@"-1" floatValue]
$2 = 1

but

(gdb) p (int)((float)[@"-1" floatValue])
$7 = -1

comes out as I expect

Why does the first expression not return -1? Also, what is the return type of [@"-1" floatValue]?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T17:31:45+00:00Added an answer on May 26, 2026 at 5:31 pm

    gdb doesn’t know the return type of methods (or functions):

    (gdb) p [@"-1" floatValue]
    Unable to call function "objc_msgSend" at 0x155d08c: no return type information available.
    To call this function anyway, you can cast the return type explicitly (e.g. 'print (float) fabs (3.0)')
    

    When you cast the expression to int, gdb assumes that the method returns an int. So it knows it can use objc_msgSend to send the message and treat the return value from objc_msgSend as an int.

    When you cast the expression to a float, gdb assumes that the method returns a float. So it knows that it should use objc_msgSend_fpret to send the message and treat the return value as a float.

    This is important because:

    On the i386 platform, the ABI for functions returning a floating-point
    value is incompatible with that for functions returning an integral
    type. On the i386 platform, therefore, you must use objc_msgSend_fpret
    for functions that for functions [sic] returning non-integral type.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've a method test that does not have a clear assert expression. The returned
I found this very handy regular expression on regexlib.com, but i'm at a loss
I have tested this servlet and it works well, except in Google Chrome it
I have this regex I built and tested in regex buddy. _ [ 0-9]{10}+
I know this particular query works, as I tested it with unprepared, procedural methods.
I run into this quite often where a new page is supposedly tested and
I tested: rm \-\-remove-files but I am unable to remove it. How can I
I have the following expression: ^\w(\s(+|-|/|*)\s\w)*$ This simply looks to match a mathematical expression,
parseInt(7em, 10); returns 7 in all browsers I tested [*]. But can I rely
using http://www.regular-expressions.info/javascriptexample.html I tested the following regex ^\\{1}([0-9])+ this is designed to match a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.