• 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
Possible Bug in GCC 4
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Possible Bug in GCC 4


  • Subject: Possible Bug in GCC 4
  • From: Brian Barnes <email@hidden>
  • Date: Sat, 14 May 2005 13:10:05 -0400

Maybe this is me, but this chunk of code:

void test(model_type *model)
{
    register int            n;
    model_texture_type        *texture;

    

    texture=model->textures;

    

    for (n=0;n!=max_model_texture;n++) {
        texture->bitmaps[0].name[0]=0x0;
        texture++;
    }
}

Returns: "warning: 'texture' is used uninitialized in this function"

Note that the definition of model_type is:

typedef struct        {
                        ... other stuff ....
                        model_texture_type        *textures;
                    } model_type;

If I leave in this code (it's in a larger function) I get corruption in other data, as if texture REALLY isn't initialized (though it obviously is.)

I can fix this by substituting:

    BlockZeroUncached(model->textures,(max_model_texture*sizeof(model_texture_type)));

And there's no more corruption in the code.  This code compiled fine in gcc 3.3.

[>] Brian
 _______________________________________________
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: Possible Bug in GCC 4
      • From: David Fang <email@hidden>
  • Prev by Date: Re: XCode/xcodebuild problems...
  • Next by Date: Re: Silly hint to simplify using Perforce SCM of the xcode project file.
  • Previous by thread: Re: SplitView
  • Next by thread: Re: Possible Bug in GCC 4
  • Index(es):
    • Date
    • Thread