9front - general discussion about 9front
 help / color / mirror / Atom feed
From: ori@eigenstate.org
To: 9front@9front.org
Subject: c99 sprintf
Date: Sun, 9 Feb 2020 11:39:18 -0800	[thread overview]
Message-ID: <E38440CD5DFE0352832DAD800B9F33D0@eigenstate.org> (raw)

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){



             reply	other threads:[~2020-02-09 19:39 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-09 19:39 ori [this message]
2020-02-09 20:29 ` [9front] " kvik
2020-02-09 20:34   ` ori

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=E38440CD5DFE0352832DAD800B9F33D0@eigenstate.org \
    --to=ori@eigenstate.org \
    --cc=9front@9front.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).