[rtems commit] monlib.[ch]: Fix warnings for external vs internal use of .h

Joel Sherrill joel at rtems.org
Thu Aug 30 13:39:24 UTC 2018


Module:    rtems
Branch:    master
Commit:    350b07a0361b13537a91a27be5e05194cf87d2ea
Changeset: http://git.rtems.org/rtems/commit/?id=350b07a0361b13537a91a27be5e05194cf87d2ea

Author:    Joel Sherrill <joel at rtems.org>
Date:      Wed Aug 29 12:34:58 2018 -0500

monlib.[ch]: Fix warnings for external vs internal use of .h

---

 bsps/arm/csb337/umon/monlib.c |  1 +
 bsps/include/umon/monlib.h    | 12 ++++++------
 2 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/bsps/arm/csb337/umon/monlib.c b/bsps/arm/csb337/umon/monlib.c
index 36f9158..44c9ec0 100644
--- a/bsps/arm/csb337/umon/monlib.c
+++ b/bsps/arm/csb337/umon/monlib.c
@@ -43,6 +43,7 @@
  *  standards and to eliminate C++ style comments.
  */
 
+#define _INSIDE_MONLIB
 #include <umon/monlib.h>
 
 static int		(*_tfsseek)(int,int,int);
diff --git a/bsps/include/umon/monlib.h b/bsps/include/umon/monlib.h
index efbfc93..c26350f 100644
--- a/bsps/include/umon/monlib.h
+++ b/bsps/include/umon/monlib.h
@@ -148,16 +148,16 @@ extern unsigned long mon_assignhandler(long hnum,
 extern struct tfshdr *mon_tfsnext(struct tfshdr *tfp);
 extern struct tfshdr *mon_tfsstat(char *filename);
 
-#if SHOWVARARGS
+/*
+ * The external caller should see these as variable argument methods but
+ * they are not implemented that way, so let monlib.c prototype them internally
+ * when building that file.
+ */
+#ifndef _INSIDE_MONLIB
 extern void mon_memtrace(char *fmt, ...);
 extern int mon_printf(char *fmt, ...);
 extern int mon_cprintf(char *fmt, ...);
 extern int mon_sprintf(char *,char *fmt, ...);
-#else
-extern void mon_memtrace();
-extern int mon_printf();
-extern int mon_cprintf();
-extern int mon_sprintf();
 #endif
 
 #ifdef __cplusplus




More information about the vc mailing list