9front - general discussion about 9front
 help / color / mirror / Atom feed
* c99 sprintf
@ 2020-02-09 19:39 ori
  2020-02-09 20:29 ` [9front] " kvik
  0 siblings, 1 reply; 3+ messages in thread
From: ori @ 2020-02-09 19:39 UTC (permalink / raw)
  To: 9front

It's been 20 years since C99 was released. It's time for this
define to go. Any objections?

diff -r 98aedbd462ee sys/include/ape/stdio.h
--- a/sys/include/ape/stdio.h	Wed Feb 05 14:11:15 2020 -0800
+++ b/sys/include/ape/stdio.h	Sun Feb 09 11:32:51 2020 -0800
@@ -88,14 +88,8 @@
 extern int printf(const char *, ...);
 extern int scanf(const char *, ...);
 extern int sprintf(char *, const char *, ...);
-#ifdef _C99_SNPRINTF_EXTENSION /* user knows about c99 out-of-bounds returns */
 extern int snprintf(char *, size_t, const char *, ...);
 extern int vsnprintf(char *, size_t, const char *, va_list);
-#else
-/* draw errors on any attempt to use *snprintf value so old code gets changed */
-extern void snprintf(char *, size_t, const char *, ...);
-extern void vsnprintf(char *, size_t, const char *, va_list);
-#endif
 extern int sscanf(const char *, const char *, ...);
 extern int vfprintf(FILE *, const char *, va_list);
 extern int vprintf(const char *, va_list);
diff -r 98aedbd462ee sys/src/ape/lib/ap/stdio/snprintf.c
--- a/sys/src/ape/lib/ap/stdio/snprintf.c	Wed Feb 05 14:11:15 2020 -0800
+++ b/sys/src/ape/lib/ap/stdio/snprintf.c	Sun Feb 09 11:32:51 2020 -0800
@@ -1,8 +1,6 @@
 /*
  * pANS stdio -- sprintf
  */
-#define _C99_SNPRINTF_EXTENSION
-
 #include "iolib.h"
 
 int snprintf(char *buf, size_t nbuf, const char *fmt, ...){
diff -r 98aedbd462ee sys/src/ape/lib/ap/stdio/vsnprintf.c
--- a/sys/src/ape/lib/ap/stdio/vsnprintf.c	Wed Feb 05 14:11:15 2020 -0800
+++ b/sys/src/ape/lib/ap/stdio/vsnprintf.c	Sun Feb 09 11:32:51 2020 -0800
@@ -1,8 +1,6 @@
 /*
  * pANS stdio -- vsnprintf
  */
-#define _C99_SNPRINTF_EXTENSION
-
 #include "iolib.h"
 
 int vsnprintf(char *buf, size_t nbuf, const char *fmt, va_list args){



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [9front] c99 sprintf
  2020-02-09 19:39 c99 sprintf ori
@ 2020-02-09 20:29 ` kvik
  2020-02-09 20:34   ` ori
  0 siblings, 1 reply; 3+ messages in thread
From: kvik @ 2020-02-09 20:29 UTC (permalink / raw)
  To: 9front

Off with its head.


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [9front] c99 sprintf
  2020-02-09 20:29 ` [9front] " kvik
@ 2020-02-09 20:34   ` ori
  0 siblings, 0 replies; 3+ messages in thread
From: ori @ 2020-02-09 20:34 UTC (permalink / raw)
  To: kvik, 9front

> Off with its head.

But it doesn't have one:

	% ape/psh
	$ head
	/bin/sh: head: not found



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-02-09 20:35 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-09 19:39 c99 sprintf ori
2020-02-09 20:29 ` [9front] " kvik
2020-02-09 20:34   ` ori

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).