summaryrefslogtreecommitdiff
path: root/libc/misc
diff options
context:
space:
mode:
authorPeter S. Mazinger <ps.m@gmx.net>2005-12-08 14:40:58 +0000
committerPeter S. Mazinger <ps.m@gmx.net>2005-12-08 14:40:58 +0000
commit2dc51f82eb1deca8f1e948d82538f2846f62950d (patch)
treefa63ca947b22d6a7d1e8d1268f592ee652c237d5 /libc/misc
parentb86c66e8f91d252ce976ff1163122f5326f6932f (diff)
Reorder so that no prototype is needed. Is there a better way to get rid of gcc warning instead of adding the loop for err/errx? attribute_noreturn is not enough ;-(
Diffstat (limited to 'libc/misc')
-rw-r--r--libc/misc/error/err.c52
1 files changed, 30 insertions, 22 deletions
diff --git a/libc/misc/error/err.c b/libc/misc/error/err.c
index 0d0637148..113c2d94f 100644
--- a/libc/misc/error/err.c
+++ b/libc/misc/error/err.c
@@ -49,62 +49,70 @@ static void vwarn_work(const char *format, va_list args, int showerr)
__STDIO_AUTO_THREADUNLOCK(stderr);
}
-extern void warn(const char *format, ...)
+void attribute_hidden __vwarn(const char *format, va_list args)
+{
+ vwarn_work(format, args, 1);
+}
+strong_alias(__vwarn,vwarn)
+
+void warn(const char *format, ...)
{
va_list args;
va_start(args, format);
- vwarn(format, args);
+ __vwarn(format, args);
va_end(args);
}
-extern void vwarn(const char *format, va_list args)
+void attribute_hidden __vwarnx(const char *format, va_list args)
{
- vwarn_work(format, args, 1);
+ vwarn_work(format, args, 0);
}
+strong_alias(__vwarnx,vwarnx)
-extern void warnx(const char *format, ...)
+void warnx(const char *format, ...)
{
va_list args;
va_start(args, format);
- vwarnx(format, args);
+ __vwarnx(format, args);
va_end(args);
}
-extern void vwarnx(const char *format, va_list args)
+void attribute_hidden __verr(int status, const char *format, va_list args)
{
- vwarn_work(format, args, 0);
+ __vwarn(format, args);
+ exit(status);
}
+strong_alias(__verr,verr)
-extern void err(int status, const char *format, ...)
+void attribute_noreturn err(int status, const char *format, ...)
{
va_list args;
va_start(args, format);
- verr(status, format, args);
+ __verr(status, format, args);
/* This should get optimized away. We'll leave it now for safety. */
- va_end(args);
+ /* The loop is added only to keep gcc happy. */
+ while(1)
+ va_end(args);
}
-extern void verr(int status, const char *format, va_list args)
+void attribute_hidden __verrx(int status, const char *format, va_list args)
{
- vwarn(format, args);
+ __vwarnx(format, args);
exit(status);
}
+strong_alias(__verrx,verrx)
-extern void errx(int status, const char *format, ...)
+void attribute_noreturn errx(int status, const char *format, ...)
{
va_list args;
va_start(args, format);
- verrx(status, format, args);
+ __verrx(status, format, args);
/* This should get optimized away. We'll leave it now for safety. */
- va_end(args);
-}
-
-extern void verrx(int status, const char *format, va_list args)
-{
- vwarnx(format, args);
- exit(status);
+ /* The loop is added only to keep gcc happy. */
+ while(1)
+ va_end(args);
}