• 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: Unused Variables warnings with global consts.h header file
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Unused Variables warnings with global consts.h header file


  • Subject: Re: Unused Variables warnings with global consts.h header file
  • From: Keary Suska <email@hidden>
  • Date: Sun, 27 Jan 2008 18:33:13 -0700
  • Thread-topic: Unused Variables warnings with global consts.h header file

on 1/27/08 5:51 AM, email@hidden purportedly said:

>
> I get these strange warnings from Xcode 2.4.1/GCC 4.0 when compiling with the
> Unused Variables switch turned on.
> The problem is caused by a global consts.h file declaring lots of constants,
> mostly enums, but also a couple of const definitions, included by almost every
> file in the project.
> For many of these files gcc gives me the warning:
>
>   warning: 'kTBButtonDef' defined but not used
>
> for my consts.h file containing these definitions:
>
>
> #ifndef _H_CONST
> #define _H_CONST
>
>
> struct tTBButtonDefinition {
> int  ControlIdx;
> char  IcnsFile[256];
> int  CommandID;
> };
>

This is because the above is a definition, rather than a declaration. It
looks like you want a declaration:

typedef struct {
int        ControlIdx;
char        IcnsFile[256];
int        CommandID;
} tTBButtonDefinition;

And I think the error will go away.

Best,

Keary Suska
Esoteritech, Inc.
"Demystifying technology for your home or business"


 _______________________________________________
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: Unused Variables warnings with global consts.h header file
      • From: "Clark Cox" <email@hidden>
References: 
 >Unused Variables warnings with global consts.h header file (From: "Jan Barnholt" <email@hidden>)

  • Prev by Date: Re: Action Cell and Matrix Madness
  • Next by Date: Re: Action Cell and Matrix Madness
  • Previous by thread: Unused Variables warnings with global consts.h header file
  • Next by thread: Re: Unused Variables warnings with global consts.h header file
  • Index(es):
    • Date
    • Thread