• 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 12:28:53 -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.

Thanks in advance,
Andy




On Dec 20, 2006, at 2:29 PM, Ladd Van Tol wrote:

On Dec 17, 2006, at 8:50 PM, Luigi Castelli wrote:

Hi there,

I am using X-code 2.4 on a Mac Powerbook Pro 2.16 GHz
Intel Core Duo.
As far as optimization is concerned, does it make a
difference which C standard I am using? I am using C99
(specified as C Language Dialect in the project
settings) because it's the one that allows the most
flexibility. However I am wondering if that comes at
the price of compiling slower code.  Would anybody
advise pro or against it? ...does it really make a
difference or it's entirely up to the programmer
taste?

C99 does allow you to use the restrict keyword, which may allow the compiler to produce better code in some cases. If you're not making use of C99-specific features, the performance should be basically identical. For more on restrict, this article offers a fairly complete explanation:


http://www.cellperformance.com/mike_acton/2006/05/ demystifying_the_restrict_keyw.html

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40soundspectrum.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
  • Follow-Ups:
    • Re: C language dialect and optimization
      • From: Shawn Erickson <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>)

  • Prev by Date: Re: undefined non-virtual thunk to ...
  • Next by Date: Re: C language dialect and optimization
  • Previous by thread: Re: C language dialect and optimization
  • Next by thread: Re: C language dialect and optimization
  • Index(es):
    • Date
    • Thread