Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C Programming > other than pragma

Reply
Thread Tools

other than pragma

 
 
parag_paul@hotmail.com
Guest
Posts: n/a
 
      02-10-2008
is there any compiler directive that will enforce optimizations?
 
Reply With Quote
 
 
 
 
Eric Sosman
Guest
Posts: n/a
 
      02-10-2008
http://www.velocityreviews.com/forums/(E-Mail Removed) wrote:
> is there any compiler directive that will enforce optimizations?


Define precisely what you mean by "optimizations."

--
Eric Sosman
(E-Mail Removed)lid
 
Reply With Quote
 
 
 
 
parag_paul@hotmail.com
Guest
Posts: n/a
 
      02-10-2008
On Feb 10, 9:09 pm, Eric Sosman <(E-Mail Removed)> wrote:
> (E-Mail Removed) wrote:
> > is there any compiler directive that will enforce optimizations?

>
> Define precisely what you mean by "optimizations."
>
> --
> Eric Sosman
> (E-Mail Removed)


Teh optmizations that cn be achived by the compile line options -O4 etc
 
Reply With Quote
 
Walter Roberson
Guest
Posts: n/a
 
      02-10-2008
In article <(E-Mail Removed)>,
(E-Mail Removed) <(E-Mail Removed)> wrote:
>On Feb 10, 9:09 pm, Eric Sosman <(E-Mail Removed)> wrote:
>> (E-Mail Removed) wrote:
>> > is there any compiler directive that will enforce optimizations?


>> Define precisely what you mean by "optimizations."


>Teh optmizations that cn be achived by the compile line options -O4 etc


The original article has not shown up here, so I am perhaps missing
some key context, but the answer is three-fold:

1) C has a very limited number of standard pragmas (and no
standard pragmas at all in C90), none of which has to do with
optimization. Any pragma along this lines that you happened to find
would be non-portable (but ignored by other compilers that did not
happen to have a pragma with the same name)

2) pragmas -suggest- rather than -enforce- .

3) I have never encountered a C compiler with a pragma that
affected optimization.
--
"All is vanity." -- Ecclesiastes
 
Reply With Quote
 
Eric Sosman
Guest
Posts: n/a
 
      02-10-2008
(E-Mail Removed) wrote:
> On Feb 10, 9:09 pm, Eric Sosman <(E-Mail Removed)> wrote:
>> (E-Mail Removed) wrote:
>>> is there any compiler directive that will enforce optimizations?

>> Define precisely what you mean by "optimizations."

>
> Teh optmizations that cn be achived by the compile line options -O4 etc


If you think this is a "precise" definition, you should
consider a career change ...

Try again: Offer a *precise* definition of "optimizations,"
using terms that are applicable to all systems where C is
implemented, and that cover all (or at least most) possible
optimality metrics. I think the effort of formulating such a
definition will teach you something valuable, and I will applaud
your sincere attempt enthusiastically by clapping one hand.

--
Eric Sosman
(E-Mail Removed)lid
 
Reply With Quote
 
Tim Prince
Guest
Posts: n/a
 
      02-10-2008
Walter Roberson wrote:
> In article <(E-Mail Removed)>,
> (E-Mail Removed) <(E-Mail Removed)> wrote:
>> On Feb 10, 9:09 pm, Eric Sosman <(E-Mail Removed)> wrote:
>>> (E-Mail Removed) wrote:
>>>> is there any compiler directive that will enforce optimizations?

>
>>> Define precisely what you mean by "optimizations."

>
>> Teh optmizations that cn be achived by the compile line options -O4 etc

>


> 3) I have never encountered a C compiler with a pragma that
> affected optimization.


This is well outside the limits of Standard C. Some of the most widely
used compilers (e.g. gcc) have no such pragmas. icc has an extremely
limited set for the latest versions. You would expect any such facilities
to be documented by the compiler in question. I don't use any compiler
which even has a -O4 option; it's fairly unusual.
 
Reply With Quote
 
Martin Ambuhl
Guest
Posts: n/a
 
      02-10-2008
(E-Mail Removed) wrote:
> is there any compiler directive that will enforce optimizations?


Most compilers have means to ask them to provide a range of
optimizations. However, those are to be found in the documentation for
those implementations, and have nothing to do with the C language
itself. The right place to look for this information is
1) in the documentation that came with your compiler
2) in FAQs for newsgroups or mailing lists or websites associated
with your implementation
3) in newsgroups, mailing lists, websites, or technical support for
your implementation
One place that it makes no sense to ask about these
implementation-specific details is a newsgroup about the language
itself, such as <news:comp.lang.c>.
 
Reply With Quote
 
christian.bau
Guest
Posts: n/a
 
      02-10-2008
On Feb 10, 4:23*pm, (E-Mail Removed)-cnrc.gc.ca (Walter Roberson)
wrote:

> 3) I have never encountered a C compiler with a pragma that
> affected optimization.


Metrowerks Codewarrior used to do that. Quite useful at times.

 
Reply With Quote
 
J. J. Farrell
Guest
Posts: n/a
 
      02-11-2008
(E-Mail Removed) wrote:
> is there any compiler directive that will enforce optimizations?


Probably; they'll be specified in your compiler documentation.
 
Reply With Quote
 
Walter Roberson
Guest
Posts: n/a
 
      02-11-2008
In article <foo46u$2vi7$(E-Mail Removed)>,
J. J. Farrell <(E-Mail Removed)> wrote:
>(E-Mail Removed) wrote:
>> is there any compiler directive that will enforce optimizations?


>Probably; they'll be specified in your compiler documentation.


In common English, "probably" would imply "more likely than not".
So far in this thread, only one compiler (icc) has been identified
specifically as having such pragmas. Can you identify other specific
compilers in wide use that support these kind of pragmas -- or should
your "probably" have been "possibly" ?

--
"Man's life is but a jest,
A dream, a shadow, bubble, air, a vapor at the best."
-- George Walter Thornbury
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Any other testing providers other than Prometric vnapoli Microsoft Certification 0 11-09-2011 09:42 PM
Month, Day etc. names in other languages other than English Diego Ruby 2 08-16-2008 02:00 AM
How to access web.sitemap file from other virtual directories other than the current application root folder? hvajja@gmail.com ASP .Net 0 08-07-2006 08:26 PM
Question regarding pragma translate_off/on , synthesis_off/on suman.nandan@gmail.com VHDL 9 07-21-2005 04:51 AM
What other produces other than "PC Anywhere"? JnlSeb Computer Information 4 01-08-2004 06:12 PM



Advertisments