delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2000/06/05/12:22:12

Message-Id: <200006051621.MAA26289@qnx.com>
Subject: Re: ANSI C and stdio.h
To: djgpp-workers AT delorie DOT com
Date: Mon, 5 Jun 2000 12:21:38 -0400 (EDT)
From: "Alain Magloire" <alain AT qnx DOT com>
In-Reply-To: <393BB137.9EA960C4@softhome.net> from "Laurynas Biveinis" at Jun 05, 2000 04:55:03 PM
X-Mailer: ELM [version 2.5 PL0b1]
MIME-Version: 1.0
Reply-To: djgpp-workers AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp-workers AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

> 
> DJ Delorie wrote:
> > 
> > > Will the requirement to include stdarg.h in order to use vprintf()
> > > count as problem?
> > 
> > If previous versions of djgpp didn't require it, that's a problem.
> 
> The fact that previous versions didn't require it does not say if
> it is good or bad thing.
> 
> > > IMHO there already is a problem - we encourage users to write
> > > unportable code.
> > 
> > No, we *allow* it, we don't *encourage* it.  I don't want to
> 
> I agree, 'allow'.
> 

 From and external view point; someone not using DJGPP day2day, but
from a maintainer that receives #ifdef __DJGPP__ || __CYGWIN__ ||
__MACOS__ || VMS   ....  and cursing them all 8-) ...
I think it should be discourage .. without enforcement ;-).  Portability
and conformance to stds are important perhaps not the end goal nor to the
point of  making everyones life miserable.  Sometimes you have to be
incompatible but it should be the exceptions not a way to avoid more FAQs
and IMHO it reflects some sort of lazyness.  Things change, stds will continue
to involve and at some point some bagages must be thrown out the window,
it depends on the long term goal and keeping things alive and kicking.

Again, I'm not the one browsing c.msdos.djgpp nor maintaining any FAQs
nor doing any use of DJGPP nor commiting any codes ... so ... take with
a grain of salt/humor.

> > gratuitously break existing code if we don't have to.
> 
> And what would mean that 'we have to'?
> 

On my Solaris box, things are quite complex but to resume :

/usr/include/stdio.h :

  #include <sys/va_list.h>

 /*
  * XPG4 requires that va_list be defined in <stdio.h> "as described in
  * <stdarg.h>".  ANSI-C and POSIX require that the namespace of <stdio.h>
  * not be polluted with this name.
  */
 #if defined(_XOPEN_SOURCE) && (_XOPEN_VERSION - 0 == 4) && !defined(_VA_LIST)
 #define _VA_LIST
 typedef __va_list va_list;
 #endif  /* defined(_XOPEN_SOURCE) && (_XOPEN_VERSION - 0 == 4) && ... */

 extern int      vfprintf(FILE *, const char *, __va_list);


On my QNX4 (Watcomm C 10.x/11.x) :

/usr/include/stdio.h:
   .....
   #ifndef __VALIST
    #ifdef  __HUGE__
     typedef char __far *__va_list[1];
    #else
     typedef char *__va_list[1];
    #endif
    #define __VALIST
   #endif

   ....
   extern int vfprintf( FILE *__fp, const char *__format, __va_list __arg );
   ....

On QNX/Neutrino (Gcc or Metrowerks ) :

/usr/include/stdio.h:

   #if defined(__WATCOMC__) && !defined(_ENABLE_AUTODEPEND)
    #pragma read_only_file;
   #endif

   #ifndef __PLATFORM_H_INCLUDED
   #include <sys/platform.h>  /* <---- contains definition of __va_list
                                      depeding if is Watcomm/GCC/Metrowerks */
   #endif
...
   extern int  vfprintf( FILE *__fp, const char *__format, __va_list __arg );
   extern int  vprintf( const char *__format, __va_list __arg );
...


-- 
au revoir, alain
----
Aussi haut que l'on soit assis, on n'est toujours assis que sur son cul !!!

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019