Clarified a bit on the os_fatal() and os_warn() functions that use va_list.
authorDavid Griffith <dave@661.org>
Fri, 28 Apr 2023 04:11:51 +0000 (21:11 -0700)
committerDavid Griffith <dave@661.org>
Fri, 28 Apr 2023 04:14:51 +0000 (21:14 -0700)
The dumb interface does not use va_list printf functions because I'm not
entirely sure if the most primitive of C compilers will support them.
For this reason, the core must not call os_fatal() or os_warn() with
formatting.  For all other interfaces, formatting may be used as long as
the implementations of os_fatal() and os_warn() are written to support it.

It should be noted here that currently only the SDL interface uses os_warn().

src/common/frotz.h

index 112623cdafeae4983394a58200c0d71a156018ed..ccae2de3becd72abcd5c6301c4c2927b023272e1 100644 (file)
@@ -879,7 +879,6 @@ void        os_display_char(zchar);
 void   os_display_string(const zchar *);
 void   os_draw_picture(int, int, int);
 void   os_erase_area(int, int, int, int, int);
-void   os_fatal(const char *, ...);
 void   os_finish_with_sample(int);
 int    os_font_data(int, int *, int *);
 void   os_init_screen(void);
@@ -909,9 +908,15 @@ int        os_storyfile_tell(FILE *);
 int    os_string_width(const zchar *);
 zword  os_to_true_colour (int);
 void   os_init_setup(void);
-void   os_warn(const char *, ...);
 void   os_quit(int);
 
+/* Don't use string expansions from the core!  The dumb interface
+ * doesn't support it for historical reasons.  Suuport in the interfaces is
+ * optional.
+ */
+void   os_fatal(const char *, ...);
+void   os_warn(const char *, ...);
+
 /**
  * Called regularly by the interpreter, at least every few instructions
  * (only when interpreting: e.g., not when waiting for input).