• 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: Don't understand this compiler warning
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Don't understand this compiler warning


  • Subject: Re: Don't understand this compiler warning
  • From: Chris Ridd <email@hidden>
  • Date: Thu, 30 Jun 2005 18:14:51 +0100

On 30/6/05 4:37, Justin C. Walker <email@hidden> wrote:

>
> On Jun 30, 2005, at 24:54 , Markus Ruggiero wrote:
>> On 28.06.2005, at 15:54, Justin C. Walker wrote:
>>> On Jun 28, 2005, at 06:39 , Markus Ruggiero wrote:
>>>> This is some very old private code (from the mid-80ies, pre ANSI-
>>>> C) that I try to port to the Mac. The code isn't mine but is
>>>> supposed to compile under Windows 3.x (!) with MSVisualStudio 4.
>>>>
>>>> I have no clue what the compiler tries to tell me:
>>>>
>>>>     auto unsigned long    lcl_l_flags = 0;
> [snip]
>> But I *do* init the variable! So still the question is open: what
>> could be wrong with this code fragment? I know, warnings are not
>> errors - and sometimes the compiler is just plain wrong and the
>> code is OK. I am just curious as to why the compiler thinks there
>> might be problems.
>
> So you do.  I overlooked that detail.  We can safely ignore my
> previous comments, then.
>
> I don't see anything obvious, but I have managed to confuse the
> compiler with sufficiently twisty code before.  I would try two things:

The problem is in the use of "lcl_l_flags |= 1". If you change the macro to
just use plain |s instead of |=s, the warning goes away. You can reduce the
problem down to:

  lcl_l_flags = lcl_l_flags |= 1;

I don't think changing the |= to | alters the logic of the code at all...

Cheers,

Chris


 _______________________________________________
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: Don't understand this compiler warning
      • From: "Justin C. Walker" <email@hidden>
References: 
 >Re: Don't understand this compiler warning (From: "Justin C. Walker" <email@hidden>)

  • Prev by Date: Re: XCode books
  • Next by Date: fopen
  • Previous by thread: Re: Don't understand this compiler warning
  • Next by thread: Re: Don't understand this compiler warning
  • Index(es):
    • Date
    • Thread