• 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: C language dialect and optimization
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: C language dialect and optimization


  • Subject: Re: C language dialect and optimization
  • From: "Andy O'Meara" <email@hidden>
  • Date: Tue, 26 Dec 2006 13:16:29 -0500





As I understand it, the line in gcc w/ c99 on:

   char* __restrict foo;

should be equivalent to the line in CW:

   char* restrict foo;

Is this correct? I ask this because in one of my master headers, I basically have:

#if __GNUC__
	#define restrict __restrict
#endif

In other words, anyone know why when c99 is enabled in gcc why usage of 'restrict' emits errors.

In C99 mode IIRC it should understand restrict directly.


Hmmm... in C99 mode, the following emits an error in gcc (but no error in CW9):


void foo( char* restrict inPtr ) {
   ...
}

I'm guessing CW9 is forgiving on a compliance issue? Otherwise, how does one communicate to the compiler for a ptr argument to be 'restrict'? I take it the answer is the unsightly approach:

void foo( char* inPtr ) {
   char* restrict ptr2 = (char* restrict) inPtr;
   ...
}

Seems kind of annoying to do, no?

Thanks,
Andy
_______________________________________________
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: 
 >C language dialect and optimization (From: Luigi Castelli <email@hidden>)
 >Re: C language dialect and optimization (From: Ladd Van Tol <email@hidden>)
 >Re: C language dialect and optimization (From: "Andy O'Meara" <email@hidden>)
 >Re: C language dialect and optimization (From: Shawn Erickson <email@hidden>)

  • Prev by Date: Re: C language dialect and optimization
  • Next by Date: Re: Automator Action doesn't see updated sdef
  • Previous by thread: Re: C language dialect and optimization
  • Next by thread: Re: C language dialect and optimization
  • Index(es):
    • Date
    • Thread