emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: nsterm.m warnings


From: Jan D.
Subject: Re: nsterm.m warnings
Date: Thu, 05 Jan 2012 08:31:05 +0100
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:8.0) Gecko/20111105 Thunderbird/8.0

Carsten Mattner skrev 2012-01-05 00:49:
On Wed, Jan 4, 2012 at 8:57 PM, Jan Djärv<address@hidden>  wrote:

4 jan 2012 kl. 18:53 skrev Carsten Mattner:

I think at least one of the following or ideally both should be fixed.

nsterm.m: In function ‘-[EmacsView conversationIdentifier]’:
nsterm.m:5053: warning: conflicting types for ‘-(long
int)conversationIdentifier’
/System/Library/Frameworks/AppKit.framework/Headers/NSInputManager.h:25:
warning: previous declaration of ‘-(NSInteger)conversationIdentifier’

What do you mean by "both"?  This is only one warning.

It's the same cause, but two warning messages.
You could logically group them to one, yes.

I see it as one warning message. There are two "warning:" in there, but they only make sense together.


It has no practical importance, and only occurs if you build a 32-bit
executable, which is rare on OSX.

If it's safe to ignore in a 32-bit build, ok.
Strictly speaking the code is incorrect, isn't it?

The code relies on the fact that the compiler can convert a long to an int on a 32-bit build. In principle such a conversion can truncate the value. But in this case it does not matter, as long as the value is unique within the application (Emacs). As the build is 32-bit, the pointer converted to long is 32-bit to start with. That long is then converted to an int, so there is no truncation.

But it is bad style to change interfaces like this, I'll fix it shortly. I guess it was long at some point in time, and then got changed to NSInteger.

        Jan D.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]