• 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: gcc 4.2 generates error that was OK before
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: gcc 4.2 generates error that was OK before


  • Subject: Re: gcc 4.2 generates error that was OK before
  • From: Jens Alfke <email@hidden>
  • Date: Tue, 22 Sep 2009 13:41:46 -0700


On Sep 22, 2009, at 11:43 AM, Steve Mills wrote:

What? Lots of functions take a single void parm. That's been legal since C version 1.0 I'd guess.
void DoSomething(void);
That's not the problem.

That's not a parameter of type 'void'. That 'void' keyword is just a marker indicating that the function takes no parameters. This is syntactic cruft introduced in ANSI C to work around the ambiguity of pre-ANSI prototype-less function declaration syntax.


I would guess there used to be a glitch in GCC where it expanded typedefs before looking for the 'void' marker, so it allowed the syntax in question; and now in 4.2 it doesn't do that anymore, and detects that the declaration is bogus.

A parameter of type 'void' is meaningless. If you don't agree, consider what the declaration "void DoSomething(void,void)" would mean...

—Jens _______________________________________________
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: gcc 4.2 generates error that was OK before
      • From: Steve Mills <email@hidden>
    • Re: gcc 4.2 generates error that was OK before
      • From: Alastair Houghton <email@hidden>
References: 
 >gcc 4.2 generates error that was OK before (From: Steve Mills <email@hidden>)
 >Re: gcc 4.2 generates error that was OK before (From: Jens Alfke <email@hidden>)
 >Re: gcc 4.2 generates error that was OK before (From: Steve Mills <email@hidden>)

  • Prev by Date: Re: gcc 4.2 generates error that was OK before
  • Next by Date: Re: gcc 4.2 generates error that was OK before
  • Previous by thread: Re: gcc 4.2 generates error that was OK before
  • Next by thread: Re: gcc 4.2 generates error that was OK before
  • Index(es):
    • Date
    • Thread