• 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: Making GCC less sensitive about duplicate typedefs?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Making GCC less sensitive about duplicate typedefs?


  • Subject: Re: Making GCC less sensitive about duplicate typedefs?
  • From: Douglas Norton <email@hidden>
  • Date: Tue, 20 Jun 2006 06:36:14 +0100

You could move the definition into a header, if it isn't already, and wrap the header file contents in a #ifndef to stop subsequent declarations being read.

// define_dummy.h

#ifndef __define_dummy_h
#define __define_dummy_h

typedef char dummy;

#endif


// main.c

#include define_dummy.h
#include define_dummy.h

int main()
{
	return 0;
}


Douglas

On 20 Jun 2006, at 00:17, Mark Wagner wrote:

The following C code compiles just fine in CodeWarrior, but gcc gives
an error of "error: conflicting types for 'dummy'".  How do I get this
sort of thing to compile with gcc?

typedef char dummy;
typedef char dummy;

int main()
{
	return 0;
}

Thanks,
Mark Wagner
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
402point5fish.com


This email sent to email@hidden


_______________________________________________ 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
References: 
 >Making GCC less sensitive about duplicate typedefs? (From: "Mark Wagner" <email@hidden>)

  • Prev by Date: Re: Making GCC less sensitive about duplicate typedefs?
  • Next by Date: Re: Making GCC less sensitive about duplicate typedefs?
  • Previous by thread: Re: Making GCC less sensitive about duplicate typedefs?
  • Next by thread: Universal Binary Crash Logs With Bogus Line Numbers
  • Index(es):
    • Date
    • Thread