public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libobjc/50368] New: Implicit, precision losing cast in objc/objc-api.h
@ 2011-09-12 19:16 florob at babelmonkeys dot de
  2011-10-09 10:51 ` [Bug libobjc/50368] " nicola at gcc dot gnu.org
  0 siblings, 1 reply; 2+ messages in thread
From: florob at babelmonkeys dot de @ 2011-09-12 19:16 UTC (permalink / raw)
  To: gcc-bugs

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

             Bug #: 50368
           Summary: Implicit, precision losing cast in objc/objc-api.h
    Classification: Unclassified
           Product: gcc
           Version: 4.6.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libobjc
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: florob@babelmonkeys.de


Hy,

I'm using (or trying to) libojc in conjunction with clang.
In this particular case it's compiling with -Wall -Werror, and stumbles over an
implicit cast in objc/objc-api.h:
/usr/lib/gcc/x86_64-unknown-linux-gnu/4.6.1/include/objc/objc-api.h:291:38:
error: implicit conversion loses integer precision: 'long' to 'int'
      [-Werror,-Wshorten-64-to-32]
  return CLS_ISCLASS(_class)?_class->version:-1;

Even without -Werror this would still generate a annoying and potenitally
confusing warning. It would be great if this cast could be made explicit in
future versions.

Regards,
Florian


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

* [Bug libobjc/50368] Implicit, precision losing cast in objc/objc-api.h
  2011-09-12 19:16 [Bug libobjc/50368] New: Implicit, precision losing cast in objc/objc-api.h florob at babelmonkeys dot de
@ 2011-10-09 10:51 ` nicola at gcc dot gnu.org
  0 siblings, 0 replies; 2+ messages in thread
From: nicola at gcc dot gnu.org @ 2011-10-09 10:51 UTC (permalink / raw)
  To: gcc-bugs

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

Nicola Pero <nicola at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
                 CC|                            |nicola at gcc dot gnu.org
         Resolution|                            |FIXED

--- Comment #1 from Nicola Pero <nicola at gcc dot gnu.org> 2011-10-09 10:50:47 UTC ---
Florian,

thanks a lot for your report.  You are right that there is a loss-precision
cast in there. :-)

But the function class_get_version() was part of the Traditional API, which was 
deprecated in GCC 4.6.1 and has been removed in trunk (ie, GCC 4.7.0).

So, the function class_get_version() (and the entire file objc/objc-api.h) will 
no longer exist in GCC 4.7.0, which implicitly fixes your problem. :-)

Thanks again!


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

end of thread, other threads:[~2011-10-09 10:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-09-12 19:16 [Bug libobjc/50368] New: Implicit, precision losing cast in objc/objc-api.h florob at babelmonkeys dot de
2011-10-09 10:51 ` [Bug libobjc/50368] " nicola 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).