Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
standard pragma's II
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  Messages 101 - 115 of 115 - Collapse all  -  Translate all to Translated (View all originals) < Older 
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
James Kuyper  
View profile  
 More options Nov 1 2010, 9:01 pm
Newsgroups: comp.lang.c, de.comp.lang.c, comp.std.c
From: James Kuyper <jameskuy...@verizon.net>
Date: Mon, 01 Nov 2010 21:01:55 -0400
Local: Mon, Nov 1 2010 9:01 pm
Subject: Re: standard pragma's II
On 11/01/2010 08:46 PM, Keith Thompson wrote:

> James Kuyper<jameskuy...@verizon.net>  writes:
>> On 10/30/2010 05:04 PM, Scouser wrote:
...
>>> They do that though, don't they?

>> As I indicated above, their own "Further notes" say explicitly that they
>> do not. Those notes might be incorrect, but that is what they say.

> This "Scouser" has posted numerous followups in comp.lang.c with the
> same one-line comment.  I don't think it means anything.

Thanks for the info. I hadn't seen those messages, so I didn't realize
that he was pointless.

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Tim Rentsch  
View profile  
 More options Nov 2 2010, 2:26 pm
Newsgroups: comp.lang.c
From: Tim Rentsch <t...@alumni.caltech.edu>
Date: Tue, 02 Nov 2010 11:26:36 -0700
Local: Tues, Nov 2 2010 2:26 pm
Subject: Re: standard pragma's II

n...@cam.ac.uk writes:
>[snip]

>     5) Setting the floating-point flags is a side-effect, so it is
> undefined behaviour if it happens twice without an intervening
> sequence point.

Bad reasoning.  It is undefined behavior to modify the stored
value of an object more than once between sequence points, but
that conclusion doesn't hold for side effects in general.  The
floating-point flags are not objects;  multiple modifications
may (or may not) be unspecified behavior, but as far as I know
there is nothing that causes it to be undefined behavior.

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
John Smith  
View profile  
 More options Nov 5 2010, 1:46 am
Newsgroups: comp.lang.c, de.comp.lang.c, comp.std.c, comp.lang.fortran
From: John Smith <j...@example.invalid>
Date: Thu, 04 Nov 2010 23:46:15 -0600
Local: Fri, Nov 5 2010 1:46 am
Subject: Re: standard pragma's II

glen herrmannsfeldt wrote:
> I am not sure anymore where this one started.  The mix of optimizing
> compilers and actual hardware sometimes gives unexpected results.

This one started when I got the news that there were, as of C99,
standard pragmas.  alternatively it began with my fascination for the
uncertain.

> Most physical scientists, used to computing with uncertainty,
> don't expect exact results from floating point.  If the computational
> errors are smaller than the physical uncertainty, all is well.
> When exact results are desired, use fixed point.  (More generally,
> for quantities with absolute uncertainty use fixed point, for
> relative uncertainty use floating point.)

Right.  But you can't pass it to C without knowing that the
representation is faithful.  "Tochno" is what russians say.

> Otherwise, it seems that one of the causes of unexpected floating
> point results is extended precision intermediate values in the x87.
> Keeping more precision for intermediate results should, in the
> end, give more accurate answers.  The combination of optimizing
> compilers (common subexpression elimination, and keeping results
> in registers as long as possible) and x87 results in uncertain
> precision in intermediate values.  

>> This kind of attitude seriously reduces the damage that ambiguities
>> in the Standard can cause.

> Well, the ambiguities are different in Fortran and C, often
> stretched when optimization is involved.

The ambiguities have a local pole when lack of precision speaks of "the
Standard."  And I know that from a lot of Poles with differing norms and
conventions.  When the subject of Fortran-C interop is given to be
relevant, then one must speak of "the C Standard," and/or "the fortran
standard."

One could speak of "the Standards."
--
John Smith


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Discussion subject changed to "OT Re: standard pragma's II" by John Smith
John Smith  
View profile  
 More options Nov 5 2010, 1:50 am
Newsgroups: comp.lang.c, de.comp.lang.c, comp.std.c, comp.lang.fortran
From: John Smith <j...@example.invalid>
Date: Thu, 04 Nov 2010 23:50:33 -0600
Local: Fri, Nov 5 2010 1:50 am
Subject: OT Re: standard pragma's II

John Smith wrote:
> James Kuyper wrote:
>> [OT]
>>> Cheers, james. I would ask you of your satellites.

>> They're still flying, 5 and 3 years, respectively, after the end of
>> their planned 5 year lifetimes, and with only minor degradation of
>> their instruments.

Can you provide a link again along with new data?
--
John Smith

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Discussion subject changed to "standard pragma's II" by John Smith
John Smith  
View profile  
 More options Nov 5 2010, 2:14 am
Newsgroups: comp.lang.c, de.comp.lang.c
From: John Smith <j...@example.invalid>
Date: Fri, 05 Nov 2010 00:14:56 -0600
Local: Fri, Nov 5 2010 2:14 am
Subject: Re: standard pragma's II

I would claim to read you, but that would violate your conclusion.  Tja.
--
john Smith

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Discussion subject changed to "OT Re: standard pragma's II" by James Kuyper
James Kuyper  
View profile  
 More options Nov 5 2010, 6:54 am
Newsgroups: comp.lang.c, de.comp.lang.c, comp.std.c, comp.lang.fortran
From: James Kuyper <jameskuy...@verizon.net>
Date: Fri, 05 Nov 2010 06:54:45 -0400
Local: Fri, Nov 5 2010 6:54 am
Subject: Re: OT Re: standard pragma's II
On 11/05/2010 01:50 AM, John Smith wrote:

> John Smith wrote:
>> James Kuyper wrote:

>>> [OT]
>>>> Cheers, james. I would ask you of your satellites.

>>> They're still flying, 5 and 3 years, respectively, after the end of
>>> their planned 5 year lifetimes, and with only minor degradation of
>>> their instruments.

> Can you provide a link again along with new data?

I don't know what this has to do with any of the newsgroups this is
being distributed to. Since you don't use a real e-mail address, the
only way I can reply is by usenet. In the future, please send  any
similar inquiries via e-mail, not usenet.

General information: <http://terra.nasa.gov/>, <http://aqua.nasa.gov/>
Data (new and old): <http://terra.nasa.gov/Gallery/>,
<http://aqua.nasa.gov/science/images_data.php>

My particular responsibility is for the  L1A, L1B, and geolocation
products from the MODIS <http://modis.gsfc.nasa.gov/> instruments on
those spacecraft. Those products may be obtained from LAADS
<http://ladsweb.nascom.nasa.gov/>, a fact which is mentioned on the
Terra data site listed above, but not on the Aqua data site.

I am not authorized to speak officially for my employer, nor for our
client, NASA. However, if you have any questions about any products
distributed through LAADS, you may send them to modaps...@sigmaspace.com
or call 1-866-506-6347; questions that fall within my domain will be
redirected to me.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
John Smith  
View profile  
 More options Nov 7 2010, 2:55 am
Newsgroups: comp.lang.c, de.comp.lang.c, comp.std.c, comp.lang.fortran
From: John Smith <j...@example.invalid>
Date: Sun, 07 Nov 2010 01:55:24 -0600
Local: Sun, Nov 7 2010 2:55 am
Subject: Re: OT Re: standard pragma's II

James Kuyper wrote:
> I don't know what this has to do with any of the newsgroups this is
> being distributed to. Since you don't use a real e-mail address, the
> only way I can reply is by usenet. In the future, please send  any
> similar inquiries via e-mail, not usenet.

It doesn't have really anything to do with a programming language.
That's what makes it OT.  I've corresponded with you before and found
your projects fascinating.

I don't have the time right now to delve into something; indeed I'm just
listening to the gas heater that I made a repair on and reading usenet
for the sake of distraction.

One won't regret firing up those links, if you're wired to be interested
in something like this excerpt:

"Physical oceanographer Jae-Hun Park helped steady a pumpkin-sized,
plastic-encased glass ball on the deck of the Research Vessel Melville.
The ball contained scientific sensors and had been moored to the sea floor
off the eastern coast of Japan for two years, collecting data about the
rapidly flowing ocean current above it. Forty-two other such glass balls
either had been retrieved or were still moored underwater. Park would
spend almost a month at sea with other researchers, retrieving these
instruments. But he was very excited about the data they would be getting
on the eddies, gyres, and meanders that make up the most active
region of the Kuroshio Current."

The reason I quote is that the writer evokes Richard Feynman from
_Surely You're Joking, Mr. Feynman_.  He was talking about an english
essay he wrote where he named the same notion in hydrodynamics.  One of
the words he used was "vortices."  What were the others?

> My particular responsibility is for the  L1A, L1B, and geolocation
> products from the MODIS <http://modis.gsfc.nasa.gov/> instruments on
> those spacecraft. Those products may be obtained from LAADS
> <http://ladsweb.nascom.nasa.gov/>, a fact which is mentioned on the
> Terra data site listed above, but not on the Aqua data site.

Correct or not, I conflate you with the people who take very precise
measurements of things that involve the shape of the earth.  The
question I've been ruminating on is how much of Russia just went up in
smoke.  Cold war relics like me wonder how we're doing in the warm war.

Does anyone know of a methodology or data to calculate the mass of
consumed tree/brush/anything that burns in places that have never been
burned like this before in the same way.

Can the satellite that now photographs the venting I've made for my
heaters also take the guesswork out of this datum?

For comparision purposes, I was thinking one could use this:

http://en.wikipedia.org/wiki/Tunguska_event

, which was probably not a good thing for the people of tuva in 1908.
In the images one sees landscapes filled with slain deciduous plants.

I would think that data for forests in Alaska would be a good start for
a napkin calculation.

> I am not authorized to speak officially for my employer, nor for our
> client, NASA. However, if you have any questions about any products
> distributed through LAADS, you may send them to modaps...@sigmaspace.com
> or call 1-866-506-6347; questions that fall within my domain will be
> redirected to me.

You're always authorized to talk to me; my Standards aren't high.:-)
--
John Smiths

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Discussion subject changed to "standard pragma's II" by John Smith
John Smith  
View profile  
 More options Nov 7 2010, 3:26 am
Newsgroups: comp.lang.c, de.comp.lang.c, comp.std.c, comp.lang.fortran
From: John Smith <j...@example.invalid>
Date: Sun, 07 Nov 2010 01:26:09 -0700
Local: Sun, Nov 7 2010 3:26 am
Subject: Re: standard pragma's II

How is the middle one a macro?
--
John Smith

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
James Kuyper  
View profile  
 More options Nov 7 2010, 6:07 am
Newsgroups: comp.lang.c, de.comp.lang.c, comp.std.c, comp.lang.fortran
From: James Kuyper <jameskuy...@verizon.net>
Date: Sun, 07 Nov 2010 06:07:33 -0500
Local: Sun, Nov 7 2010 6:07 am
Subject: Re: standard pragma's II
On 11/07/2010 03:26 AM, John Smith wrote:

The phrase "the middle one" could have several possible meanings, but I
can't figure out how to interpret it as applying to FLT_EVAL_METHOD,
which was the only thing that I identified as being a macro. However, I
believe that it's possible to implement float_t and double_t either as
typedefs or macros. Or, for that matter, as macros that expand to
typedef names, though that would be pointlessly complicated.

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
n...@cam.ac.uk  
View profile  
 More options Nov 7 2010, 6:57 am
Newsgroups: comp.lang.c, de.comp.lang.c, comp.std.c, comp.lang.fortran
Followup-To: comp.lang.c, de.comp.lang.c, comp.std.c
From: n...@cam.ac.uk
Date: Sun, 7 Nov 2010 11:57:00 +0000 (GMT)
Subject: Re: standard pragma's II
In article <ib619n$2d...@news.eternal-september.org>,
James Kuyper  <jameskuy...@verizon.net> wrote:

I am changing the followup line to remove comp.lang.fortran,
which is the only one of the groups I am following, but am going to
respond.

What you have posted was, indeed, the intent of the committee.  It
is not, however, what the C99 standard says.  Like so much else of
C99 (and a lot of C90), none of those facilities are usable in even
remotely portable code because only their syntax and intent is
defined by the standard - their semantics are, at most, implementation-
defined and more often unspecified or even undefined.  And, yes, I
DO mean that using them is arguably undefined behaviour.

FLT_EVAL_METHOD is unclear which operations it controls, and exactly
when it applies (given that constant and dynamic evaluation are not
required to be identical).  It is also permitted to be set to -1,
and there are no specified constraints involving __STDC_IEC_559__
or FP_CONTRACT or CX_LIMITED_RANGE.

The float_t and double_t types are likely to be macros, because
7.12#2 states that they ARE built-in types for some values of
FLT_EVAL_METHOD.  That is incompatible with using typedefs for them
in those cases.  Also, unless FLT_EVAL_METHOD is 0, 1 or 2, they
have no connexion with expression evaluation.

God alone knows what FP_CONTRACT means (let alone CX_LIMITED_RANGE)
because there is no specification of how expressions are evaluated
other than the "as if" rule, though many people will read Annex F
to imply that there is.  But, in any case, that applies only if
both __STDC_IEC_559__ is 1 and pragma FENV_ACCESS is on.

As someone who has a lot of experience with numerical portability and
reliability, stretching over four decades and dozens of very different
systems, my advice to anyone concerned with those is not to touch
the new features of C99 with a bargepole.  Write clean, portable
code and don't rely on compiler-, hardware- and system-dependent
facilities.

Regards,
Nick Maclaren.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
James Kuyper  
View profile  
 More options Nov 7 2010, 8:03 am
Newsgroups: comp.lang.c, de.comp.lang.c, comp.std.c
From: James Kuyper <jameskuy...@verizon.net>
Date: Sun, 07 Nov 2010 08:03:15 -0500
Local: Sun, Nov 7 2010 8:03 am
Subject: Re: standard pragma's II
On 11/07/2010 06:57 AM, n...@cam.ac.uk wrote:
...

> I am changing the followup line to remove comp.lang.fortran,
> which is the only one of the groups I am following, but am going to
> respond.

> What you have posted was, indeed, the intent of the committee.  It
> is not, however, what the C99 standard says.  Like so much else of
> C99 (and a lot of C90), none of those facilities are usable in even
> remotely portable code because only their syntax and intent is
> defined by the standard - their semantics are, at most, implementation-
> defined and more often unspecified or even undefined.  And, yes, I
> DO mean that using them is arguably undefined behaviour.

> FLT_EVAL_METHOD is unclear which operations it controls,

5.2.4.2.2p8 seems pretty clear: "operations with floating operands and
values". Can you come up with any argument, from the text of the
standard, why it should not apply to every "operation with floating
operands and values", or why it should apply to any operations that
don't fit that description? It doesn't have to be a great argument; just
good enough to justify your asserting that there's a lack of clarity.
Alternatively, identify a case where it's unclear whether or not that
description applies. I'm not saying that there are no such cases; only
that I can't think of any, and it would clarify the nature of your
complaint if I had an example to think about.

> ... and exactly
> when it applies (given that constant and dynamic evaluation are not
> required to be identical).  ...

Nonetheless, 5.2.4.2.2p8 makes it quite clear that values 0, 1 and 2 all
identify behavior which covers constants as well as operations.

> ...  It is also permitted to be set to -1,

So? Are you worse off having a way of knowing that the float evaluation
method is indeterminable than you would be if you didn't have any way to
determine that fact?

> and there are no specified constraints involving __STDC_IEC_559__
> or FP_CONTRACT or CX_LIMITED_RANGE.
> The float_t and double_t types are likely to be macros, because
> 7.12#2 states that they ARE built-in types for some values of
> FLT_EVAL_METHOD.  That is incompatible with using typedefs for them
> in those cases.  Also, unless FLT_EVAL_METHOD is 0, 1 or 2, they
> have no connexion with expression evaluation.

So? If FLT_EVAL_METHOD is 0, 1, or 2, there is a connection, which seems
somewhat useful to me. Having that connection, and being able to
determine what that connection is and whether it even exists, all seem
fairly useful. I don't see how having those features makes things worse
than when they didn't exist. At worst, FLT_EVAL_METHOD == 1, and you
have a way of finding out that out; which is slightly better than
knowing nothing at all about such issues.

> God alone knows what FP_CONTRACT means (let alone CX_LIMITED_RANGE)
> because there is no specification of how expressions are evaluated
> other than the "as if" rule, though many people will read Annex F
> to imply that there is.  But, in any case, that applies only if
> both __STDC_IEC_559__ is 1 and pragma FENV_ACCESS is on.

So, it does have a meaning when __STDC_IEC_559__ is 1 and FENV_ACCESS is
on? How does the existence of the FP_CONTRACT, __STDC_IEC_559__ and
FENV_ACCESS features make the situation worse than when you had no way
of ever determining, from within your code, whether or not that meaning
applied?

> As someone who has a lot of experience with numerical portability and
> reliability, stretching over four decades and dozens of very different
> systems, my advice to anyone concerned with those is not to touch
> the new features of C99 with a bargepole.  Write clean, portable
> code and don't rely on compiler-, hardware- and system-dependent
> facilities.

C99 provides ways of determining whether certain compiler-, hardware-,
and system-dependent facilities are supported. Why shouldn't code use
those facilities when they are supported, and choose an appropriate
fall-back method when they aren't (which might be to refuse to attempt
the calculation)? Granted, in many cases, it may be appropriate to
simply always use the fall-back, so there's no need to even check.
However, that's not always the case, and the new facilities allow you to
do something other than the fall back, if you want to. How does the
presence of those facilities make the situation any worse then it was
without them?

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Keith Thompson  
View profile  
 More options Nov 7 2010, 1:19 pm
Newsgroups: comp.lang.c, de.comp.lang.c, comp.std.c
From: Keith Thompson <ks...@mib.org>
Date: Sun, 07 Nov 2010 10:19:48 -0800
Local: Sun, Nov 7 2010 1:19 pm
Subject: Re: standard pragma's II
n...@cam.ac.uk writes:

[...]
> The float_t and double_t types are likely to be macros, because
> 7.12#2 states that they ARE built-in types for some values of
> FLT_EVAL_METHOD.  That is incompatible with using typedefs for them
> in those cases.  Also, unless FLT_EVAL_METHOD is 0, 1 or 2, they
> have no connexion with expression evaluation.

[...]

float_t and double_t are almost certainly typedefs.  The standard
doesn't say or imply that they're macros.  If they were, then this:

    #include <math.h>
    int main(void) {
        int float_t;
        return 0;
    }

would be invalid, which I believe would violate 7.1.3.

The statement that they *are* built-in types is entirely consistent
with them being typedefs.  A typedef does not introduce a new type,
just an alias for an existing one (6.7.7p3).

--
Keith Thompson (The_Other_Keith) ks...@mib.org  <http://www.ghoti.net/~kst>
Nokia
"We must do something.  This is something.  Therefore, we must do this."
    -- Antony Jay and Jonathan Lynn, "Yes Minister"


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
John Smith  
View profile  
 More options Nov 8 2010, 10:30 pm
Newsgroups: comp.lang.c, de.comp.lang.c, comp.std.c
From: John Smith <j...@example.invalid>
Date: Mon, 08 Nov 2010 20:30:54 -0700
Local: Mon, Nov 8 2010 10:30 pm
Subject: Re: standard pragma's II

Interesting, Keith.  If your logic is good to this point, why isn't it
correct to say they can't be macros?

What I think the case is that they aren't macros for folks writing
portable, sane, functional C code but somehow they can be in a low level
and meaningless manner.
--
John Smith


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
John Smith  
View profile  
 More options Nov 8 2010, 10:37 pm
Newsgroups: comp.lang.c, de.comp.lang.c, comp.std.c, comp.lang.fortran
From: John Smith <j...@example.invalid>
Date: Mon, 08 Nov 2010 20:37:34 -0700
Local: Mon, Nov 8 2010 10:37 pm
Subject: Re: standard pragma's II

I've been sporadic on newsreading lately and simply wanted to thank you
for the good read.  (also the selfish motivation to want to serialize
your comments.)  Cheers,
--
John Smith

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Keith Thompson  
View profile  
 More options Nov 9 2010, 12:45 am
Newsgroups: comp.lang.c, de.comp.lang.c, comp.std.c
From: Keith Thompson <ks...@mib.org>
Date: Mon, 08 Nov 2010 21:45:17 -0800
Local: Tues, Nov 9 2010 12:45 am
Subject: Re: standard pragma's II

It probably is.  I was being cautious, in case there's something
I've missed that implies they can be macros.  But I presented an
argument that they can't be: they're identifiers with file scope,
so they're reserved for use as macro names and as identifiers with
file scope in the same name space <math.h> is included (C99 7.1.3p1)
-- which implies that they're *not* reserved for use as identifiers
with block scope.

On the other hand, that's a bit of a circular argument.  The standard
doesn't explicitly say they have file scope; I'm assuming they
are because it makes sense for them to be typedefs.  Then again,
they certainly *can* be typedefs.

On the other other other hand, C99 7.12p1 says that "The header
<math.h> declares two types ..."; a macro definition doesn't declare
a type.

I'm about 98% sure that the standard intends for them to be
typedefs, about 99% sure that the standard at least permits them
to be typedefs, and about 95% sure that it forbids them to be macros.
(Don't read too much into the specific percentages.)

> What I think the case is that they aren't macros for folks writing
> portable, sane, functional C code but somehow they can be in a low
> level and meaningless manner.

I'm not sure what that means.  Whether they're macros or not (if the
standard permitted them to be) would depend on the implementation,
not on any user-written code.  And there's no ambiguity whether
they're macros or not for a given implementation:

#include <math.h>
#include <stdio.h>
int main(void)
{
#ifdef float_t
    puts("float_t is a macro");
#else
    puts("float_t is not a macro");
#endif
    return 0;

}

(I believe that this program cannot print "float_t is a macro"
under a conforming implementation.)

--
Keith Thompson (The_Other_Keith) ks...@mib.org  <http://www.ghoti.net/~kst>
Nokia
"We must do something.  This is something.  Therefore, we must do this."
    -- Antony Jay and Jonathan Lynn, "Yes Minister"


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages < Older 
« Back to Discussions « Newer topic     Older topic »