PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Autres forums > Forum Programmation & Conception > comp.lang.c > E*
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
E*

Réponse
 
LinkBack Outils de la discussion
Vieux 10/05/2008, 22h12   #1
Richard Tobin
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut E*

7.26.3 Errors <errno.h>
Macros that begin with E and a digit or E and an uppercase letter
may be added to the declarations in the <errno.h> header.

May an implementation define an error macro EOF with a value different
from the EOF in <stdio.h>?

-- Richard
--
:wq
  Réponse avec citation
Vieux 11/05/2008, 04h06   #2
lawrence.jones@siemens.com
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: E*

Richard Tobin <richard@cogsci.ed.ac.uk> wrote:
> 7.26.3 Errors <errno.h>
> Macros that begin with E and a digit or E and an uppercase letter
> may be added to the declarations in the <errno.h> header.
>
> May an implementation define an error macro EOF with a value different
> from the EOF in <stdio.h>?


No. A strictly conforming program is allowed to include both headers
and the conflicting definitions of EOF would violate the constraint in
6.10.3p2. Since a conforming implementation is not allowed to have
entensions that invalidate strictly conforming programs, such a
definition is not allowed.

Conformance questions like this really belong in comp.std.c where
there's less traffic, much less heat, and far more light than there is
here.

-- Larry Jones

I think we need to change the rules. -- Calvin
  Réponse avec citation
Vieux 11/05/2008, 05h01   #3
Jack Klein
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: E*

On 10 May 2008 21:12:28 GMT, richard@cogsci.ed.ac.uk (Richard Tobin)
wrote in comp.lang.c:

> 7.26.3 Errors <errno.h>
> Macros that begin with E and a digit or E and an uppercase letter
> may be added to the declarations in the <errno.h> header.
>
> May an implementation define an error macro EOF with a value different
> from the EOF in <stdio.h>?


Perhaps in a non-standard extra include file, or guarded by some
conditional compilation guard in <errno.h>.

It could not unconditionally include such a definition in <errno.h>
when the compiler is invoked in conforming mode because it would break
conforming programs that included both <stdio.h> and <errno.h>.

--
Jack Klein
Home: http://JK-Technology.Com
FAQs for
comp.lang.c http://c-faq.com/
comp.lang.c++ http://www.parashift.com/c++-faq-lite/
alt.comp.lang.learn.c-c++
http://www.club.cc.cmu.edu/~ajo/docs/FAQ-acllc.html
  Réponse avec citation
Vieux 11/05/2008, 14h01   #4
Eric Sosman
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: E*

Richard Tobin wrote:
> 7.26.3 Errors <errno.h>
> Macros that begin with E and a digit or E and an uppercase letter
> may be added to the declarations in the <errno.h> header.
>
> May an implementation define an error macro EOF with a value different
> from the EOF in <stdio.h>?


No, because a conforming program can include both <stdio.h>
and <errno.h>. Note that the freedom to add more EXXX macros
in <errno.h> does not imply that every EXXX macro everywhere
must be an error number.

The paragraph can be read as a warning and as an implied
promise. First, it warns you not to use EEYORE for your own
purposes, because a future <errno.h> might define it. And
second, it implies that future <errno.h> versions will *not*
define E12MANY or EiEiO or E_IS_FOR_ELEPHANT, so you can use
those identifiers as you wish. However, implications are not
actual promises: Witness C99's encroachment on names reserved
to the programmer in C90.

--
Eric Sosman
esosman@ieee-dot-org.invalid
  Réponse avec citation
Vieux 11/05/2008, 14h10   #5
Harald van Dijk
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: E*

On Sun, 11 May 2008 09:01:36 -0400, Eric Sosman wrote:
> Richard Tobin wrote:
>> 7.26.3 Errors <errno.h>
>> Macros that begin with E and a digit or E and an uppercase letter
>> may be added to the declarations in the <errno.h> header.

>
> The paragraph can be read as a warning and as an implied
> promise. First, it warns you not to use EEYORE for your own purposes,
> because a future <errno.h> might define it. And second, it implies that
> future <errno.h> versions will *not* define E12MANY or EiEiO or
> E_IS_FOR_ELEPHANT, so you can use those identifiers as you wish.


Why can't E12MANY be defined? It's a macro that begins with E and a digit,
which is allowed, right? I'm asking because E2BIG is a fairly common real-
world macro provided by <errno.h>.
  Réponse avec citation
Vieux 11/05/2008, 14h49   #6
Eric Sosman
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: E*

Harald van Dijk wrote:
> On Sun, 11 May 2008 09:01:36 -0400, Eric Sosman wrote:
>> Richard Tobin wrote:
>>> 7.26.3 Errors <errno.h>
>>> Macros that begin with E and a digit or E and an uppercase letter
>>> may be added to the declarations in the <errno.h> header.

>> The paragraph can be read as a warning and as an implied
>> promise. First, it warns you not to use EEYORE for your own purposes,
>> because a future <errno.h> might define it. And second, it implies that
>> future <errno.h> versions will *not* define E12MANY or EiEiO or
>> E_IS_FOR_ELEPHANT, so you can use those identifiers as you wish.

>
> Why can't E12MANY be defined? It's a macro that begins with E and a digit,
> which is allowed, right? I'm asking because E2BIG is a fairly common real-
> world macro provided by <errno.h>.


Oops! My blunder; sorry.

--
Eric Sosman
esosman@ieee-dot-org.invalid
  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 17h45.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,13983 seconds with 14 queries