aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBernhard Reutner-Fischer <rep.dot.nop@gmail.com>2006-01-22 22:55:11 +0000
committerBernhard Reutner-Fischer <rep.dot.nop@gmail.com>2006-01-22 22:55:11 +0000
commit86f5c9906beac527f3d7966f24811b571a589e08 (patch)
tree1c9eba853c728b5d734506e1c66c269d96fe46ea
parent2edf52643d3eb3d13f26d31f9678cf122f2063bc (diff)
downloadbusybox-w32-86f5c9906beac527f3d7966f24811b571a589e08.tar.gz
busybox-w32-86f5c9906beac527f3d7966f24811b571a589e08.tar.bz2
busybox-w32-86f5c9906beac527f3d7966f24811b571a589e08.zip
- add platform.h.
- use shorter boilerplate while at it.
-rw-r--r--Makefile13
-rw-r--r--applets/busybox.c2
-rw-r--r--archival/libunarchive/header_skip.c2
-rw-r--r--archival/unzip.c23
-rw-r--r--coreutils/stty.c13
-rw-r--r--e2fsprogs/tune2fs.c2
-rw-r--r--e2fsprogs/uuid/uuid.h2
-rw-r--r--editors/awk.c19
-rw-r--r--include/busybox.h23
-rw-r--r--include/libbb.h43
-rw-r--r--include/platform.h82
-rw-r--r--loginutils/adduser.c17
-rw-r--r--loginutils/getty.c2
-rw-r--r--networking/inetd.c22
-rw-r--r--networking/libiproute/ip_common.h5
-rw-r--r--networking/libiproute/iproute.c2
-rw-r--r--networking/libiproute/utils.h9
-rw-r--r--networking/nameif.c4
-rw-r--r--networking/traceroute.c2
-rw-r--r--networking/udhcp/arpping.h2
-rw-r--r--networking/udhcp/dhcpc.c18
-rw-r--r--networking/udhcp/dumpleases.c6
-rw-r--r--networking/zcip.c19
-rw-r--r--shell/ash.c34
-rw-r--r--shell/hush.c16
-rw-r--r--shell/lash.c17
-rw-r--r--sysklogd/klogd.c19
-rw-r--r--sysklogd/syslogd.c17
-rw-r--r--util-linux/fdisk.c9
-rw-r--r--util-linux/fsck_minix.c2
30 files changed, 182 insertions, 264 deletions
diff --git a/Makefile b/Makefile
index b71803d74..267f6b7b6 100644
--- a/Makefile
+++ b/Makefile
@@ -381,7 +381,7 @@ docs/busybox.net/BusyBox.html: docs/busybox.pod
381scripts/bb_mkdep: $(top_srcdir)/scripts/bb_mkdep.c 381scripts/bb_mkdep: $(top_srcdir)/scripts/bb_mkdep.c
382 $(HOSTCC) $(HOSTCFLAGS) -o $@ $< 382 $(HOSTCC) $(HOSTCFLAGS) -o $@ $<
383 383
384DEP_INCLUDES := include/config.h include/bb_config.h 384DEP_INCLUDES := include/config.h include/bb_config.h include/_usage.h
385 385
386ifeq ($(strip $(CONFIG_BBCONFIG)),y) 386ifeq ($(strip $(CONFIG_BBCONFIG)),y)
387DEP_INCLUDES += include/bbconfigopts.h 387DEP_INCLUDES += include/bbconfigopts.h
@@ -411,13 +411,22 @@ include/bb_config.h: include/config.h
411 < $< >> $@ 411 < $< >> $@
412 @echo "#endif" >> $@ 412 @echo "#endif" >> $@
413 413
414# Create macros for usage.h, e.g.:
415#if ENABLE_HAVE_DOT_CONFIG
416#define USAGE_HAVE_DOT_CONFIG(a) a
417#else
418#define USAGE_HAVE_DOT_CONFIG(a)
419#endif
420include/_usage.h: .config
421 awk '/CONFIG|BB_APPLET/{gsub("#[[:space:]]*|=y|.*CONFIG_|.*BB_APPLET_","");if(!/=/){print("#if ENABLE_"$$1"\n#define USAGE_"$$1"(a) a\n#else\n#define USAGE_"$$1"(a)\n#endif");}}' $(<) > $(@)
422
414clean: 423clean:
415 - $(MAKE) -C scripts/config $@ 424 - $(MAKE) -C scripts/config $@
416 - $(RM_F) docs/busybox.dvi docs/busybox.ps \ 425 - $(RM_F) docs/busybox.dvi docs/busybox.ps \
417 docs/busybox.pod docs/busybox.net/busybox.html \ 426 docs/busybox.pod docs/busybox.net/busybox.html \
418 docs/busybox pod2htm* *.gdb *.elf *~ core .*config.log \ 427 docs/busybox pod2htm* *.gdb *.elf *~ core .*config.log \
419 docs/BusyBox.txt docs/BusyBox.1 docs/BusyBox.html \ 428 docs/BusyBox.txt docs/BusyBox.1 docs/BusyBox.html \
420 docs/busybox.net/BusyBox.html busybox.links libbb/loop.h \ 429 docs/busybox.net/BusyBox.html busybox.links include/_usage.h \
421 $(DO_INSTALL_LIBS) $(LIBBUSYBOX_SONAME) \ 430 $(DO_INSTALL_LIBS) $(LIBBUSYBOX_SONAME) \
422 .config.old busybox 431 .config.old busybox
423 - rm -rf _install testsuite/links 432 - rm -rf _install testsuite/links
diff --git a/applets/busybox.c b/applets/busybox.c
index 3d7a0fd0b..db78b7ccd 100644
--- a/applets/busybox.c
+++ b/applets/busybox.c
@@ -11,7 +11,7 @@
11#define setlocale(x,y) 11#define setlocale(x,y)
12#endif 12#endif
13 13
14const char *bb_applet_name __attribute__((externally_visible)); 14const char *bb_applet_name ATTRIBUTE_EXTERNALLY_VISIBLE;
15 15
16#ifdef CONFIG_FEATURE_INSTALLER 16#ifdef CONFIG_FEATURE_INSTALLER
17/* 17/*
diff --git a/archival/libunarchive/header_skip.c b/archival/libunarchive/header_skip.c
index 0b153980e..963d113a4 100644
--- a/archival/libunarchive/header_skip.c
+++ b/archival/libunarchive/header_skip.c
@@ -1,6 +1,6 @@
1#include <stdio.h> 1#include <stdio.h>
2#include "unarchive.h" 2#include "unarchive.h"
3 3
4extern void header_skip(const file_header_t *file_header __attribute__((unused))) 4extern void header_skip(const file_header_t *file_header ATTRIBUTE_UNUSED)
5{ 5{
6} 6}
diff --git a/archival/unzip.c b/archival/unzip.c
index 50d148692..caac716cc 100644
--- a/archival/unzip.c
+++ b/archival/unzip.c
@@ -7,20 +7,7 @@
7 * Loosely based on original busybox unzip applet by Laurence Anderson. 7 * Loosely based on original busybox unzip applet by Laurence Anderson.
8 * All options and features should work in this version. 8 * All options and features should work in this version.
9 * 9 *
10 * This program is free software; you can redistribute it and/or modify 10 * Licensed under the GPL v2 or later, see the file LICENSE in this tarball.
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
14 *
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 * General Public License for more details.
19 *
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 *
24 */ 11 */
25 12
26/* For reference see 13/* For reference see
@@ -79,12 +66,12 @@ typedef union {
79 unsigned short method; /* 4-5 */ 66 unsigned short method; /* 4-5 */
80 unsigned short modtime; /* 6-7 */ 67 unsigned short modtime; /* 6-7 */
81 unsigned short moddate; /* 8-9 */ 68 unsigned short moddate; /* 8-9 */
82 unsigned int crc32 __attribute__ ((packed)); /* 10-13 */ 69 unsigned int crc32 ATTRIBUTE_PACKED; /* 10-13 */
83 unsigned int cmpsize __attribute__ ((packed)); /* 14-17 */ 70 unsigned int cmpsize ATTRIBUTE_PACKED; /* 14-17 */
84 unsigned int ucmpsize __attribute__ ((packed)); /* 18-21 */ 71 unsigned int ucmpsize ATTRIBUTE_PACKED; /* 18-21 */
85 unsigned short filename_len; /* 22-23 */ 72 unsigned short filename_len; /* 22-23 */
86 unsigned short extra_len; /* 24-25 */ 73 unsigned short extra_len; /* 24-25 */
87 } formated __attribute__ ((packed)); 74 } formated ATTRIBUTE_PACKED;
88} zip_header_t; 75} zip_header_t;
89 76
90static void unzip_skip(int fd, off_t skip) 77static void unzip_skip(int fd, off_t skip)
diff --git a/coreutils/stty.c b/coreutils/stty.c
index d62068668..cbd2c22e9 100644
--- a/coreutils/stty.c
+++ b/coreutils/stty.c
@@ -2,15 +2,8 @@
2/* stty -- change and print terminal line settings 2/* stty -- change and print terminal line settings
3 Copyright (C) 1990-1999 Free Software Foundation, Inc. 3 Copyright (C) 1990-1999 Free Software Foundation, Inc.
4 4
5 This program is free software; you can redistribute it and/or modify 5 Licensed under the GPL v2 or later, see the file LICENSE in this tarball.
6 it under the terms of the GNU General Public License as published by 6*/
7 the Free Software Foundation; either version 2, or (at your option)
8 any later version.
9
10 You should have received a copy of the GNU General Public License
11 along with this program; if not, write to the Free Software Foundation,
12 Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
13
14/* Usage: stty [-ag] [-F device] [setting...] 7/* Usage: stty [-ag] [-F device] [setting...]
15 8
16 Options: 9 Options:
@@ -428,7 +421,7 @@ static void set_window_size(int rows, int cols, int fd);
428 421
429static const char *device_name; 422static const char *device_name;
430 423
431static __attribute__ ((noreturn)) void perror_on_device(const char *fmt) 424static ATTRIBUTE_NORETURN void perror_on_device(const char *fmt)
432{ 425{
433 bb_perror_msg_and_die(fmt, device_name); 426 bb_perror_msg_and_die(fmt, device_name);
434} 427}
diff --git a/e2fsprogs/tune2fs.c b/e2fsprogs/tune2fs.c
index e36c47734..f23688bc3 100644
--- a/e2fsprogs/tune2fs.c
+++ b/e2fsprogs/tune2fs.c
@@ -566,7 +566,7 @@ MOUNTS_COUNT_ERROR:
566} 566}
567 567
568#ifdef CONFIG_FINDFS 568#ifdef CONFIG_FINDFS
569static attribute_noreturn void do_findfs(int argc, char **argv) 569static ATTRIBUTE_NORETURN void do_findfs(int argc, char **argv)
570{ 570{
571 if ((argc != 2) || 571 if ((argc != 2) ||
572 (strncmp(argv[1], "LABEL=", 6) && strncmp(argv[1], "UUID=", 5))) 572 (strncmp(argv[1], "LABEL=", 6) && strncmp(argv[1], "UUID=", 5)))
diff --git a/e2fsprogs/uuid/uuid.h b/e2fsprogs/uuid/uuid.h
index ec6ba52d7..a05f1c690 100644
--- a/e2fsprogs/uuid/uuid.h
+++ b/e2fsprogs/uuid/uuid.h
@@ -54,7 +54,7 @@ typedef unsigned char uuid_t[16];
54/* Allow UUID constants to be defined */ 54/* Allow UUID constants to be defined */
55#ifdef __GNUC__ 55#ifdef __GNUC__
56#define UUID_DEFINE(name,u0,u1,u2,u3,u4,u5,u6,u7,u8,u9,u10,u11,u12,u13,u14,u15) \ 56#define UUID_DEFINE(name,u0,u1,u2,u3,u4,u5,u6,u7,u8,u9,u10,u11,u12,u13,u14,u15) \
57 static const uuid_t name __attribute__ ((unused)) = {u0,u1,u2,u3,u4,u5,u6,u7,u8,u9,u10,u11,u12,u13,u14,u15} 57 static const uuid_t name ATTRIBUTE_UNUSED = {u0,u1,u2,u3,u4,u5,u6,u7,u8,u9,u10,u11,u12,u13,u14,u15}
58#else 58#else
59#define UUID_DEFINE(name,u0,u1,u2,u3,u4,u5,u6,u7,u8,u9,u10,u11,u12,u13,u14,u15) \ 59#define UUID_DEFINE(name,u0,u1,u2,u3,u4,u5,u6,u7,u8,u9,u10,u11,u12,u13,u14,u15) \
60 static const uuid_t name = {u0,u1,u2,u3,u4,u5,u6,u7,u8,u9,u10,u11,u12,u13,u14,u15} 60 static const uuid_t name = {u0,u1,u2,u3,u4,u5,u6,u7,u8,u9,u10,u11,u12,u13,u14,u15}
diff --git a/editors/awk.c b/editors/awk.c
index 4bd872924..80ff8c77b 100644
--- a/editors/awk.c
+++ b/editors/awk.c
@@ -4,20 +4,7 @@
4 * 4 *
5 * Copyright (C) 2002 by Dmitry Zakharov <dmit@crp.bank.gov.ua> 5 * Copyright (C) 2002 by Dmitry Zakharov <dmit@crp.bank.gov.ua>
6 * 6 *
7 * This program is free software; you can redistribute it and/or modify 7 * Licensed under the GPL v2 or later, see the file LICENSE in this tarball.
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 *
21 */ 8 */
22 9
23#include <stdio.h> 10#include <stdio.h>
@@ -445,7 +432,7 @@ static void chain_group(void);
445static var *evaluate(node *, var *); 432static var *evaluate(node *, var *);
446static rstream *next_input_file(void); 433static rstream *next_input_file(void);
447static int fmt_num(char *, int, const char *, double, int); 434static int fmt_num(char *, int, const char *, double, int);
448static int awk_exit(int) attribute_noreturn; 435static int awk_exit(int) ATTRIBUTE_NORETURN;
449 436
450/* ---- error handling ---- */ 437/* ---- error handling ---- */
451 438
@@ -462,7 +449,7 @@ static const char EMSG_UNDEF_FUNC[] = "Call to undefined function";
462static const char EMSG_NO_MATH[] = "Math support is not compiled in"; 449static const char EMSG_NO_MATH[] = "Math support is not compiled in";
463#endif 450#endif
464 451
465static void syntax_error(const char * const message) attribute_noreturn; 452static void syntax_error(const char * const message) ATTRIBUTE_NORETURN;
466static void syntax_error(const char * const message) 453static void syntax_error(const char * const message)
467{ 454{
468 bb_error_msg_and_die("%s:%i: %s", programname, lineno, message); 455 bb_error_msg_and_die("%s:%i: %s", programname, lineno, message);
diff --git a/include/busybox.h b/include/busybox.h
index f16be706d..9fb95036e 100644
--- a/include/busybox.h
+++ b/include/busybox.h
@@ -2,24 +2,7 @@
2/* 2/*
3 * Busybox main internal header file 3 * Busybox main internal header file
4 * 4 *
5 * 5 * Licensed under the GPL v2 or later, see the file LICENSE in this tarball.
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 *
20 * Based in part on code from sash, Copyright (c) 1999 by David I. Bell
21 * Permission has been granted to redistribute this code under the GPL.
22 *
23 */ 6 */
24#ifndef _BB_INTERNAL_H_ 7#ifndef _BB_INTERNAL_H_
25#define _BB_INTERNAL_H_ 1 8#define _BB_INTERNAL_H_ 1
@@ -66,8 +49,8 @@ enum SUIDRoot {
66struct BB_applet { 49struct BB_applet {
67 const char *name; 50 const char *name;
68 int (*main) (int argc, char **argv); 51 int (*main) (int argc, char **argv);
69 enum Location location:4; 52 __extension__ enum Location location:4;
70 enum SUIDRoot need_suid:4; 53 __extension__ enum SUIDRoot need_suid:4;
71}; 54};
72 55
73/* From busybox.c */ 56/* From busybox.c */
diff --git a/include/libbb.h b/include/libbb.h
index 2e697a350..8ec1a24c0 100644
--- a/include/libbb.h
+++ b/include/libbb.h
@@ -2,27 +2,14 @@
2/* 2/*
3 * Busybox main internal header file 3 * Busybox main internal header file
4 * 4 *
5 * 5 * Licensed under the GPL v2 or later, see the file LICENSE in this tarball.
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 * 6 *
20 * Based in part on code from sash, Copyright (c) 1999 by David I. Bell 7 * Based in part on code from sash, Copyright (c) 1999 by David I. Bell
21 * Permission has been granted to redistribute this code under the GPL. 8 * Permission has been granted to redistribute this code under the GPL.
22 * 9 *
23 */ 10 */
24#ifndef __LIBCONFIG_H__ 11#ifndef __LIBBUSYBOX_H__
25#define __LIBCONFIG_H__ 1 12#define __LIBBUSYBOX_H__ 1
26 13
27#include <stdio.h> 14#include <stdio.h>
28#include <stdlib.h> 15#include <stdlib.h>
@@ -36,6 +23,7 @@
36 23
37#include <features.h> 24#include <features.h>
38 25
26#include "platform.h"
39#include "bb_config.h" 27#include "bb_config.h"
40#ifdef CONFIG_SELINUX 28#ifdef CONFIG_SELINUX
41#include <selinux/selinux.h> 29#include <selinux/selinux.h>
@@ -50,21 +38,6 @@
50# include "sha1.h" 38# include "sha1.h"
51#endif 39#endif
52 40
53/* Convenience macros to test the version of gcc. */
54#if defined __GNUC__ && defined __GNUC_MINOR__
55# define __GNUC_PREREQ(maj, min) \
56 ((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min))
57#else
58# define __GNUC_PREREQ(maj, min) 0
59#endif
60
61/* __restrict is known in EGCS 1.2 and above. */
62#if !__GNUC_PREREQ (2,92)
63# define __restrict /* Ignore */
64#endif
65
66#define attribute_noreturn __attribute__ ((__noreturn__))
67
68/* Some useful definitions */ 41/* Some useful definitions */
69#define FALSE ((int) 0) 42#define FALSE ((int) 0)
70#define TRUE ((int) 1) 43#define TRUE ((int) 1)
@@ -86,7 +59,7 @@
86#define MAX(a,b) (((a)>(b))?(a):(b)) 59#define MAX(a,b) (((a)>(b))?(a):(b))
87#endif 60#endif
88 61
89extern void bb_show_usage(void) __attribute__ ((noreturn, externally_visible)); 62extern void bb_show_usage(void) ATTRIBUTE_NORETURN ATTRIBUTE_EXTERNALLY_VISIBLE;
90extern void bb_error_msg(const char *s, ...) __attribute__ ((format (printf, 1, 2))); 63extern void bb_error_msg(const char *s, ...) __attribute__ ((format (printf, 1, 2)));
91extern void bb_error_msg_and_die(const char *s, ...) __attribute__ ((noreturn, format (printf, 1, 2))); 64extern void bb_error_msg_and_die(const char *s, ...) __attribute__ ((noreturn, format (printf, 1, 2)));
92extern void bb_perror_msg(const char *s, ...) __attribute__ ((format (printf, 1, 2))); 65extern void bb_perror_msg(const char *s, ...) __attribute__ ((format (printf, 1, 2)));
@@ -95,7 +68,7 @@ extern void bb_vherror_msg(const char *s, va_list p);
95extern void bb_herror_msg(const char *s, ...) __attribute__ ((format (printf, 1, 2))); 68extern void bb_herror_msg(const char *s, ...) __attribute__ ((format (printf, 1, 2)));
96extern void bb_herror_msg_and_die(const char *s, ...) __attribute__ ((noreturn, format (printf, 1, 2))); 69extern void bb_herror_msg_and_die(const char *s, ...) __attribute__ ((noreturn, format (printf, 1, 2)));
97 70
98extern void bb_perror_nomsg_and_die(void) __attribute__ ((noreturn)); 71extern void bb_perror_nomsg_and_die(void) ATTRIBUTE_NORETURN;
99extern void bb_perror_nomsg(void); 72extern void bb_perror_nomsg(void);
100 73
101/* These two are used internally -- you shouldn't need to use them */ 74/* These two are used internally -- you shouldn't need to use them */
@@ -147,7 +120,7 @@ extern FILE *bb_wfopen_input(const char *filename);
147extern FILE *bb_xfopen(const char *path, const char *mode); 120extern FILE *bb_xfopen(const char *path, const char *mode);
148 121
149extern int bb_fclose_nonstdin(FILE *f); 122extern int bb_fclose_nonstdin(FILE *f);
150extern void bb_fflush_stdout_and_exit(int retval) __attribute__ ((noreturn)); 123extern void bb_fflush_stdout_and_exit(int retval) ATTRIBUTE_NORETURN;
151 124
152#define BB_GETOPT_ERROR 0x80000000UL 125#define BB_GETOPT_ERROR 0x80000000UL
153extern const char *bb_opt_complementally; 126extern const char *bb_opt_complementally;
@@ -498,4 +471,4 @@ extern int hash_fd(int fd, const size_t size, const uint8_t hash_algo, uint8_t *
498#include <dmalloc.h> 471#include <dmalloc.h>
499#endif 472#endif
500 473
501#endif /* __LIBCONFIG_H__ */ 474#endif /* __LIBBUSYBOX_H__ */
diff --git a/include/platform.h b/include/platform.h
new file mode 100644
index 000000000..763292d7a
--- /dev/null
+++ b/include/platform.h
@@ -0,0 +1,82 @@
1/*
2 Copyright 2006, Bernhard Fischer
3
4 Licensed under the GPL v2 or later, see the file LICENSE in this tarball.
5*/
6#ifndef __PLATFORM_H
7#define __PLATFORM_H 1
8
9/* Convenience macros to test the version of gcc. */
10#undef __GNUC_PREREQ
11#if defined __GNUC__ && defined __GNUC_MINOR__
12# define __GNUC_PREREQ(maj, min) \
13 ((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min))
14#else
15# define __GNUC_PREREQ(maj, min) 0
16#endif
17
18/* __restrict is known in EGCS 1.2 and above. */
19#if !__GNUC_PREREQ (2,92)
20# ifndef __restrict
21# define __restrict /* Ignore */
22# endif
23#endif
24
25/* Define macros for some gcc attributes. This permits us to use the
26 macros freely, and know that they will come into play for the
27 version of gcc in which they are supported. */
28
29#if !__GNUC_PREREQ (2,7)
30# ifndef __attribute__
31# define __attribute__(x)
32# endif
33#endif
34
35#if 0
36/* Attribute __malloc__ on functions was valid as of gcc 2.96. */
37#ifndef ATTRIBUTE_MALLOC
38# if __GNUC_PREREQ (2,96)
39# define ATTRIBUTE_MALLOC __attribute__ ((__malloc__))
40# else
41# define ATTRIBUTE_MALLOC
42# endif /* GNUC >= 2.96 */
43#endif /* ATTRIBUTE_MALLOC */
44#endif
45
46#ifndef ATTRIBUTE_UNUSED
47#define ATTRIBUTE_UNUSED __attribute__ ((__unused__))
48#endif /* ATTRIBUTE_UNUSED */
49
50#ifndef ATTRIBUTE_NORETURN
51#define ATTRIBUTE_NORETURN __attribute__ ((__noreturn__))
52#endif /* ATTRIBUTE_NORETURN */
53
54#ifndef ATTRIBUTE_PACKED
55#define ATTRIBUTE_PACKED __attribute__ ((__packed__))
56#endif /* ATTRIBUTE_NORETURN */
57
58/* -fwhole-program makes all symbols local. The attribute externally_visible
59 forces a symbol global. */
60#ifndef ATTRIBUTE_EXTERNALLY_VISIBLE
61# if __GNUC_PREREQ (4,1)
62# define ATTRIBUTE_EXTERNALLY_VISIBLE __attribute__ ((__externally_visible__))
63# else
64# define ATTRIBUTE_EXTERNALLY_VISIBLE
65# endif /* GNUC >= 4.1 */
66#endif /* ATTRIBUTE_EXTERNALLY_VISIBLE */
67
68/* We use __extension__ in some places to suppress -pedantic warnings
69 about GCC extensions. This feature didn't work properly before
70 gcc 2.8. */
71#if !__GNUC_PREREQ (2,8)
72# ifndef __extension__
73# define __extension__
74# endif
75#endif
76
77
78/* include USAGE_APPLET_x helper macros for usage.h. */
79/*
80#include "_usage.h"
81*/
82#endif /* platform.h */
diff --git a/loginutils/adduser.c b/loginutils/adduser.c
index 5ff0cd962..a25632e44 100644
--- a/loginutils/adduser.c
+++ b/loginutils/adduser.c
@@ -5,20 +5,7 @@
5 * Copyright (C) 1999 by Lineo, inc. and John Beppu 5 * Copyright (C) 1999 by Lineo, inc. and John Beppu
6 * Copyright (C) 1999,2000,2001 by John Beppu <beppu@codepoet.org> 6 * Copyright (C) 1999,2000,2001 by John Beppu <beppu@codepoet.org>
7 * 7 *
8 * This program is free software; you can redistribute it and/or modify 8 * Licensed under the GPL v2 or later, see the file LICENSE in this tarball.
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 *
22 */ 9 */
23 10
24#ifndef _GNU_SOURCE 11#ifndef _GNU_SOURCE
@@ -122,7 +109,7 @@ static void addgroup_wrapper(const char *login, gid_t gid)
122 free(cmd); 109 free(cmd);
123} 110}
124 111
125static void passwd_wrapper(const char *login) __attribute__ ((noreturn)); 112static void passwd_wrapper(const char *login) ATTRIBUTE_NORETURN;
126 113
127static void passwd_wrapper(const char *login) 114static void passwd_wrapper(const char *login)
128{ 115{
diff --git a/loginutils/getty.c b/loginutils/getty.c
index 1cfbd6734..1399118a5 100644
--- a/loginutils/getty.c
+++ b/loginutils/getty.c
@@ -225,7 +225,7 @@ static void termio_final(struct options *op, struct termio *tp,
225 struct chardata *cp); 225 struct chardata *cp);
226static int caps_lock(const char *s); 226static int caps_lock(const char *s);
227static int bcode(const char *s); 227static int bcode(const char *s);
228static void error(const char *fmt, ...) __attribute__ ((noreturn)); 228static void error(const char *fmt, ...) ATTRIBUTE_NORETURN;
229 229
230#ifdef SYSV_STYLE 230#ifdef SYSV_STYLE
231#ifdef CONFIG_FEATURE_UTMP 231#ifdef CONFIG_FEATURE_UTMP
diff --git a/networking/inetd.c b/networking/inetd.c
index 5388bf789..7a6ffae0c 100644
--- a/networking/inetd.c
+++ b/networking/inetd.c
@@ -928,7 +928,7 @@ static int matchconf (servtab_t *old, servtab_t *new)
928 return (1); 928 return (1);
929} 929}
930 930
931static void config (int sig __attribute__((unused))) 931static void config (int sig ATTRIBUTE_UNUSED)
932{ 932{
933 servtab_t *sep, *cp, **sepp; 933 servtab_t *sep, *cp, **sepp;
934 sigset_t omask; 934 sigset_t omask;
@@ -1149,7 +1149,7 @@ static void config (int sig __attribute__((unused)))
1149} 1149}
1150 1150
1151 1151
1152static void reapchild (int sig __attribute__((unused))) 1152static void reapchild (int sig ATTRIBUTE_UNUSED)
1153{ 1153{
1154 pid_t pid; 1154 pid_t pid;
1155 int save_errno = errno, status; 1155 int save_errno = errno, status;
@@ -1176,7 +1176,7 @@ static void reapchild (int sig __attribute__((unused)))
1176 errno = save_errno; 1176 errno = save_errno;
1177} 1177}
1178 1178
1179static void retry (int sig __attribute__((unused))) 1179static void retry (int sig ATTRIBUTE_UNUSED)
1180{ 1180{
1181 servtab_t *sep; 1181 servtab_t *sep;
1182 1182
@@ -1200,7 +1200,7 @@ static void retry (int sig __attribute__((unused)))
1200 } 1200 }
1201} 1201}
1202 1202
1203static void goaway (int sig __attribute__((unused))) 1203static void goaway (int sig ATTRIBUTE_UNUSED)
1204{ 1204{
1205 servtab_t *sep; 1205 servtab_t *sep;
1206 1206
@@ -1582,7 +1582,7 @@ echo_stream (int s, servtab_t *sep)
1582/* Echo service -- echo data back */ 1582/* Echo service -- echo data back */
1583/* ARGSUSED */ 1583/* ARGSUSED */
1584static void 1584static void
1585echo_dg (int s, servtab_t *sep __attribute__((unused))) 1585echo_dg (int s, servtab_t *sep ATTRIBUTE_UNUSED)
1586{ 1586{
1587 char buffer[BUFSIZE]; 1587 char buffer[BUFSIZE];
1588 int i; 1588 int i;
@@ -1616,7 +1616,7 @@ discard_stream (int s, servtab_t *sep)
1616/* Discard service -- ignore data */ 1616/* Discard service -- ignore data */
1617/* ARGSUSED */ 1617/* ARGSUSED */
1618static void 1618static void
1619discard_dg (int s, servtab_t *sep __attribute__((unused))) 1619discard_dg (int s, servtab_t *sep ATTRIBUTE_UNUSED)
1620{ 1620{
1621 char buffer[BUFSIZE]; 1621 char buffer[BUFSIZE];
1622 1622
@@ -1678,7 +1678,7 @@ chargen_stream (int s, servtab_t *sep)
1678/* Character generator */ 1678/* Character generator */
1679/* ARGSUSED */ 1679/* ARGSUSED */
1680static void 1680static void
1681chargen_dg (int s, servtab_t *sep __attribute__((unused))) 1681chargen_dg (int s, servtab_t *sep ATTRIBUTE_UNUSED)
1682{ 1682{
1683 /* struct sockaddr_storage ss; */ 1683 /* struct sockaddr_storage ss; */
1684 struct sockaddr sa; 1684 struct sockaddr sa;
@@ -1735,7 +1735,7 @@ static u_int machtime (void)
1735 1735
1736/* ARGSUSED */ 1736/* ARGSUSED */
1737static void 1737static void
1738machtime_stream (int s, servtab_t *sep __attribute__((unused))) 1738machtime_stream (int s, servtab_t *sep ATTRIBUTE_UNUSED)
1739{ 1739{
1740 u_int result; 1740 u_int result;
1741 1741
@@ -1745,7 +1745,7 @@ machtime_stream (int s, servtab_t *sep __attribute__((unused)))
1745 1745
1746/* ARGSUSED */ 1746/* ARGSUSED */
1747static void 1747static void
1748machtime_dg (int s, servtab_t *sep __attribute__((unused))) 1748machtime_dg (int s, servtab_t *sep ATTRIBUTE_UNUSED)
1749{ 1749{
1750 u_int result; 1750 u_int result;
1751 /* struct sockaddr_storage ss; */ 1751 /* struct sockaddr_storage ss; */
@@ -1770,7 +1770,7 @@ machtime_dg (int s, servtab_t *sep __attribute__((unused)))
1770#ifdef CONFIG_FEATURE_INETD_SUPPORT_BILTIN_DAYTIME 1770#ifdef CONFIG_FEATURE_INETD_SUPPORT_BILTIN_DAYTIME
1771/* Return human-readable time of day */ 1771/* Return human-readable time of day */
1772/* ARGSUSED */ 1772/* ARGSUSED */
1773static void daytime_stream (int s, servtab_t *sep __attribute__((unused))) 1773static void daytime_stream (int s, servtab_t *sep ATTRIBUTE_UNUSED)
1774{ 1774{
1775 char buffer[256]; 1775 char buffer[256];
1776 time_t t; 1776 time_t t;
@@ -1784,7 +1784,7 @@ static void daytime_stream (int s, servtab_t *sep __attribute__((unused)))
1784/* Return human-readable time of day */ 1784/* Return human-readable time of day */
1785/* ARGSUSED */ 1785/* ARGSUSED */
1786void 1786void
1787daytime_dg (int s, servtab_t *sep __attribute__((unused))) 1787daytime_dg (int s, servtab_t *sep ATTRIBUTE_UNUSED)
1788{ 1788{
1789 char buffer[256]; 1789 char buffer[256];
1790 time_t t; 1790 time_t t;
diff --git a/networking/libiproute/ip_common.h b/networking/libiproute/ip_common.h
index 25e9c6c81..71be8269e 100644
--- a/networking/libiproute/ip_common.h
+++ b/networking/libiproute/ip_common.h
@@ -1,3 +1,5 @@
1#ifndef _IP_COMMON_H
2#define _IP_COMMON_H 1
1extern int preferred_family; 3extern int preferred_family;
2extern char * _SL_; 4extern char * _SL_;
3 5
@@ -5,7 +7,7 @@ extern void ip_parse_common_args(int *argcp, char ***argvp);
5extern int print_neigh(struct sockaddr_nl *who, struct nlmsghdr *n, void *arg); 7extern int print_neigh(struct sockaddr_nl *who, struct nlmsghdr *n, void *arg);
6extern int ipaddr_list_or_flush(int argc, char **argv, int flush); 8extern int ipaddr_list_or_flush(int argc, char **argv, int flush);
7extern int iproute_monitor(int argc, char **argv); 9extern int iproute_monitor(int argc, char **argv);
8extern void iplink_usage(void) __attribute__((noreturn)); 10extern void iplink_usage(void) ATTRIBUTE_NORETURN;
9extern void ipneigh_reset_filter(void); 11extern void ipneigh_reset_filter(void);
10extern int do_ipaddr(int argc, char **argv); 12extern int do_ipaddr(int argc, char **argv);
11extern int do_iproute(int argc, char **argv); 13extern int do_iproute(int argc, char **argv);
@@ -16,3 +18,4 @@ extern int do_iplink(int argc, char **argv);
16extern int do_ipmonitor(int argc, char **argv); 18extern int do_ipmonitor(int argc, char **argv);
17extern int do_multiaddr(int argc, char **argv); 19extern int do_multiaddr(int argc, char **argv);
18extern int do_multiroute(int argc, char **argv); 20extern int do_multiroute(int argc, char **argv);
21#endif /* ip_common.h */
diff --git a/networking/libiproute/iproute.c b/networking/libiproute/iproute.c
index a15fc81dc..b622afd47 100644
--- a/networking/libiproute/iproute.c
+++ b/networking/libiproute/iproute.c
@@ -63,7 +63,7 @@ static int flush_update(void)
63 return 0; 63 return 0;
64} 64}
65 65
66static int print_route(struct sockaddr_nl *who __attribute__((unused)), 66static int print_route(struct sockaddr_nl *who ATTRIBUTE_UNUSED,
67 struct nlmsghdr *n, void *arg) 67 struct nlmsghdr *n, void *arg)
68{ 68{
69 FILE *fp = (FILE*)arg; 69 FILE *fp = (FILE*)arg;
diff --git a/networking/libiproute/utils.h b/networking/libiproute/utils.h
index e79e177b9..3d223edf6 100644
--- a/networking/libiproute/utils.h
+++ b/networking/libiproute/utils.h
@@ -7,6 +7,7 @@
7#include "libnetlink.h" 7#include "libnetlink.h"
8#include "ll_map.h" 8#include "ll_map.h"
9#include "rtm_map.h" 9#include "rtm_map.h"
10#include "libbb.h"
10 11
11extern int preferred_family; 12extern int preferred_family;
12extern int show_stats; 13extern int show_stats;
@@ -26,7 +27,7 @@ extern char * _SL_;
26#define SPRINT_BSIZE 64 27#define SPRINT_BSIZE 64
27#define SPRINT_BUF(x) char x[SPRINT_BSIZE] 28#define SPRINT_BUF(x) char x[SPRINT_BSIZE]
28 29
29extern void incomplete_command(void) __attribute__((noreturn)); 30extern void incomplete_command(void) ATTRIBUTE_NORETURN;
30 31
31#define NEXT_ARG() do { argv++; if (--argc <= 0) incomplete_command(); } while(0) 32#define NEXT_ARG() do { argv++; if (--argc <= 0) incomplete_command(); } while(0)
32 33
@@ -76,9 +77,9 @@ extern int get_s8(__s8 *val, char *arg, int base);
76extern const char *format_host(int af, int len, void *addr, char *buf, int buflen); 77extern const char *format_host(int af, int len, void *addr, char *buf, int buflen);
77extern const char *rt_addr_n2a(int af, int len, void *addr, char *buf, int buflen); 78extern const char *rt_addr_n2a(int af, int len, void *addr, char *buf, int buflen);
78 79
79void invarg(char *, char *) __attribute__((noreturn)); 80void invarg(char *, char *) ATTRIBUTE_NORETURN;
80void duparg(char *, char *) __attribute__((noreturn)); 81void duparg(char *, char *) ATTRIBUTE_NORETURN;
81void duparg2(char *, char *) __attribute__((noreturn)); 82void duparg2(char *, char *) ATTRIBUTE_NORETURN;
82int matches(char *arg, char *pattern); 83int matches(char *arg, char *pattern);
83extern int inet_addr_match(inet_prefix *a, inet_prefix *b, int bits); 84extern int inet_addr_match(inet_prefix *a, inet_prefix *b, int bits);
84 85
diff --git a/networking/nameif.c b/networking/nameif.c
index a2c8b4915..f28e5ebe3 100644
--- a/networking/nameif.c
+++ b/networking/nameif.c
@@ -5,7 +5,7 @@
5 * Busybox port 2002 by Nick Fedchik <nick@fedchik.org.ua> 5 * Busybox port 2002 by Nick Fedchik <nick@fedchik.org.ua>
6 * Glenn McGrath <bug1@iinet.net.au> 6 * Glenn McGrath <bug1@iinet.net.au>
7 * 7 *
8 * Licensed under the GPL v2 or later, see the file LICENSE in this tarball. 8 * Licensed under the GPL v2 or later, see the file LICENSE in this tarball.
9 */ 9 */
10 10
11#include <sys/syslog.h> 11#include <sys/syslog.h>
@@ -48,7 +48,7 @@ typedef struct mactable_s {
48 48
49static unsigned long flags; 49static unsigned long flags;
50 50
51static void serror(const char *s, ...) __attribute__ ((noreturn)); 51static void serror(const char *s, ...) ATTRIBUTE_NORETURN;
52 52
53static void serror(const char *s, ...) 53static void serror(const char *s, ...)
54{ 54{
diff --git a/networking/traceroute.c b/networking/traceroute.c
index 690e21f82..b6252ad3e 100644
--- a/networking/traceroute.c
+++ b/networking/traceroute.c
@@ -281,7 +281,7 @@ struct hostinfo {
281struct outdata { 281struct outdata {
282 u_char seq; /* sequence number of this packet */ 282 u_char seq; /* sequence number of this packet */
283 u_char ttl; /* ttl packet left with */ 283 u_char ttl; /* ttl packet left with */
284 struct timeval tv __attribute__((packed)); /* time packet left */ 284 struct timeval tv ATTRIBUTE_PACKED; /* time packet left */
285}; 285};
286 286
287struct IFADDRLIST { 287struct IFADDRLIST {
diff --git a/networking/udhcp/arpping.h b/networking/udhcp/arpping.h
index 6f27d9f75..30959ca99 100644
--- a/networking/udhcp/arpping.h
+++ b/networking/udhcp/arpping.h
@@ -27,7 +27,7 @@ struct arpMsg {
27 uint8_t tHaddr[6]; /* target's hardware address */ 27 uint8_t tHaddr[6]; /* target's hardware address */
28 uint8_t tInaddr[4]; /* target's IP address */ 28 uint8_t tInaddr[4]; /* target's IP address */
29 uint8_t pad[18]; /* pad for min. Ethernet payload (60 bytes) */ 29 uint8_t pad[18]; /* pad for min. Ethernet payload (60 bytes) */
30} __attribute__ ((packed)); 30} ATTRIBUTE_PACKED;
31 31
32/* function prototypes */ 32/* function prototypes */
33int arpping(uint32_t yiaddr, uint32_t ip, uint8_t *arp, char *interface); 33int arpping(uint32_t yiaddr, uint32_t ip, uint8_t *arp, char *interface);
diff --git a/networking/udhcp/dhcpc.c b/networking/udhcp/dhcpc.c
index d5c69db42..c4277e3f1 100644
--- a/networking/udhcp/dhcpc.c
+++ b/networking/udhcp/dhcpc.c
@@ -4,19 +4,7 @@
4 * 4 *
5 * Russ Dill <Russ.Dill@asu.edu> July 2001 5 * Russ Dill <Russ.Dill@asu.edu> July 2001
6 * 6 *
7 * This program is free software; you can redistribute it and/or modify 7 * Licensed under the GPL v2 or later, see the file LICENSE in this tarball.
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 */ 8 */
21 9
22#include <sys/time.h> 10#include <sys/time.h>
@@ -74,7 +62,7 @@ struct client_config_t client_config = {
74}; 62};
75 63
76#ifndef IN_BUSYBOX 64#ifndef IN_BUSYBOX
77static void __attribute__ ((noreturn)) show_usage(void) 65static void ATTRIBUTE_NORETURN show_usage(void)
78{ 66{
79 printf( 67 printf(
80"Usage: udhcpc [OPTIONS]\n\n" 68"Usage: udhcpc [OPTIONS]\n\n"
@@ -101,7 +89,7 @@ static void __attribute__ ((noreturn)) show_usage(void)
101} 89}
102#else 90#else
103#define show_usage bb_show_usage 91#define show_usage bb_show_usage
104extern void show_usage(void) __attribute__ ((noreturn)); 92extern void show_usage(void) ATTRIBUTE_NORETURN;
105#endif 93#endif
106 94
107 95
diff --git a/networking/udhcp/dumpleases.c b/networking/udhcp/dumpleases.c
index a9036dfbd..ca5c6059e 100644
--- a/networking/udhcp/dumpleases.c
+++ b/networking/udhcp/dumpleases.c
@@ -1,3 +1,7 @@
1/* vi: set sw=4 ts=4: */
2/*
3 Licensed under the GPL v2 or later, see the file LICENSE in this tarball.
4 */
1#include <fcntl.h> 5#include <fcntl.h>
2#include <string.h> 6#include <string.h>
3#include <stdlib.h> 7#include <stdlib.h>
@@ -21,7 +25,7 @@
21 25
22 26
23#ifndef IN_BUSYBOX 27#ifndef IN_BUSYBOX
24static void __attribute__ ((noreturn)) show_usage(void) 28static void ATTRIBUTE_NORETURN show_usage(void)
25{ 29{
26 printf( 30 printf(
27"Usage: dumpleases -f <file> -[r|a]\n\n" 31"Usage: dumpleases -f <file> -[r|a]\n\n"
diff --git a/networking/zcip.c b/networking/zcip.c
index ad1131f3b..294ffd066 100644
--- a/networking/zcip.c
+++ b/networking/zcip.c
@@ -5,20 +5,7 @@
5 * Copyright (C) 2003 by Arthur van Hoff (avh@strangeberry.com) 5 * Copyright (C) 2003 by Arthur van Hoff (avh@strangeberry.com)
6 * Copyright (C) 2004 by David Brownell 6 * Copyright (C) 2004 by David Brownell
7 * 7 *
8 * This program is free software; you can redistribute it and/or modify 8 * Licensed under the GPL v2 or later, see the file LICENSE in this tarball.
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
21 * 02111-1307 USA
22 */ 9 */
23 10
24/* 11/*
@@ -73,7 +60,7 @@ struct arp_packet {
73 struct in_addr source_ip; 60 struct in_addr source_ip;
74 struct ether_addr target_addr; 61 struct ether_addr target_addr;
75 struct in_addr target_ip; 62 struct in_addr target_ip;
76} __attribute__ ((__packed__)); 63} ATTRIBUTE_PACKED;
77 64
78/* 169.254.0.0 */ 65/* 169.254.0.0 */
79static const uint32_t LINKLOCAL_ADDR = 0xa9fe0000; 66static const uint32_t LINKLOCAL_ADDR = 0xa9fe0000;
@@ -214,7 +201,7 @@ bad:
214/** 201/**
215 * Print usage information. 202 * Print usage information.
216 */ 203 */
217static void __attribute__((noreturn)) 204static void ATTRIBUTE_NORETURN
218zcip_usage(const char *msg) 205zcip_usage(const char *msg)
219{ 206{
220 fprintf(stderr, "%s: %s\n", prog, msg); 207 fprintf(stderr, "%s: %s\n", prog, msg);
diff --git a/shell/ash.c b/shell/ash.c
index db537c44d..ef1fe0af7 100644
--- a/shell/ash.c
+++ b/shell/ash.c
@@ -12,19 +12,7 @@
12 * This code is derived from software contributed to Berkeley by 12 * This code is derived from software contributed to Berkeley by
13 * Kenneth Almquist. 13 * Kenneth Almquist.
14 * 14 *
15 * This program is free software; you can redistribute it and/or modify 15 * Licensed under the GPL v2 or later, see the file LICENSE in this tarball.
16 * it under the terms of the GNU General Public License as published by
17 * the Free Software Foundation; either version 2 of the License, or
18 * (at your option) any later version.
19 *
20 * This program is distributed in the hope that it will be useful,
21 * but WITHOUT ANY WARRANTY; without even the implied warranty of
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
23 * General Public License for more details.
24 *
25 * You should have received a copy of the GNU General Public License
26 * along with this program; if not, write to the Free Software
27 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
28 * 16 *
29 * Original BSD copyright notice is retained at the end of this file. 17 * Original BSD copyright notice is retained at the end of this file.
30 */ 18 */
@@ -233,11 +221,11 @@ static volatile sig_atomic_t pendingsigs;
233/* EXSIG is turned off by evalbltin(). */ 221/* EXSIG is turned off by evalbltin(). */
234 222
235 223
236static void exraise(int) __attribute__((__noreturn__)); 224static void exraise(int) ATTRIBUTE_NORETURN;
237static void onint(void) __attribute__((__noreturn__)); 225static void onint(void) ATTRIBUTE_NORETURN;
238 226
239static void sh_error(const char *, ...) __attribute__((__noreturn__)); 227static void sh_error(const char *, ...) ATTRIBUTE_NORETURN;
240static void exerror(int, const char *, ...) __attribute__((__noreturn__)); 228static void exerror(int, const char *, ...) ATTRIBUTE_NORETURN;
241 229
242static void sh_warnx(const char *, ...); 230static void sh_warnx(const char *, ...);
243 231
@@ -1400,7 +1388,7 @@ struct cmdentry {
1400static const char *pathopt; /* set by padvance */ 1388static const char *pathopt; /* set by padvance */
1401 1389
1402static void shellexec(char **, const char *, int) 1390static void shellexec(char **, const char *, int)
1403 __attribute__((__noreturn__)); 1391 ATTRIBUTE_NORETURN;
1404static char *padvance(const char **, const char *); 1392static char *padvance(const char **, const char *);
1405static void find_command(char *, struct cmdentry *, int, const char *); 1393static void find_command(char *, struct cmdentry *, int, const char *);
1406static struct builtincmd *find_builtin(const char *); 1394static struct builtincmd *find_builtin(const char *);
@@ -2026,7 +2014,7 @@ static void ignoresig(int);
2026static void onsig(int); 2014static void onsig(int);
2027static int dotrap(void); 2015static int dotrap(void);
2028static void setinteractive(int); 2016static void setinteractive(int);
2029static void exitshell(void) __attribute__((__noreturn__)); 2017static void exitshell(void) ATTRIBUTE_NORETURN;
2030static int decode_signal(const char *, int); 2018static int decode_signal(const char *, int);
2031 2019
2032/* 2020/*
@@ -2504,7 +2492,7 @@ setpwd(const char *val, int setold)
2504 2492
2505 2493
2506static void exverror(int, const char *, va_list) 2494static void exverror(int, const char *, va_list)
2507 __attribute__((__noreturn__)); 2495 ATTRIBUTE_NORETURN;
2508 2496
2509/* 2497/*
2510 * Called to raise an exception. Since C doesn't include exceptions, we 2498 * Called to raise an exception. Since C doesn't include exceptions, we
@@ -4518,7 +4506,7 @@ static size_t esclen(const char *, const char *);
4518static char *scanleft(char *, char *, char *, char *, int, int); 4506static char *scanleft(char *, char *, char *, char *, int, int);
4519static char *scanright(char *, char *, char *, char *, int, int); 4507static char *scanright(char *, char *, char *, char *, int, int);
4520static void varunset(const char *, const char *, const char *, int) 4508static void varunset(const char *, const char *, const char *, int)
4521 __attribute__((__noreturn__)); 4509 ATTRIBUTE_NORETURN;
4522 4510
4523 4511
4524#define pmatch(a, b) !fnmatch((a), (b), 0) 4512#define pmatch(a, b) !fnmatch((a), (b), 0)
@@ -9325,8 +9313,8 @@ static int readtoken(void);
9325static int xxreadtoken(void); 9313static int xxreadtoken(void);
9326static int readtoken1(int firstc, int syntax, char *eofmark, int striptabs); 9314static int readtoken1(int firstc, int syntax, char *eofmark, int striptabs);
9327static int noexpand(char *); 9315static int noexpand(char *);
9328static void synexpect(int) __attribute__((__noreturn__)); 9316static void synexpect(int) ATTRIBUTE_NORETURN;
9329static void synerror(const char *) __attribute__((__noreturn__)); 9317static void synerror(const char *) ATTRIBUTE_NORETURN;
9330static void setprompt(int); 9318static void setprompt(int);
9331 9319
9332 9320
diff --git a/shell/hush.c b/shell/hush.c
index e83d49a86..70533a2b0 100644
--- a/shell/hush.c
+++ b/shell/hush.c
@@ -75,19 +75,7 @@
75 * maybe change map[] to use 2-bit entries 75 * maybe change map[] to use 2-bit entries
76 * (eventually) remove all the printf's 76 * (eventually) remove all the printf's
77 * 77 *
78 * This program is free software; you can redistribute it and/or modify 78 * Licensed under the GPL v2 or later, see the file LICENSE in this tarball.
79 * it under the terms of the GNU General Public License as published by
80 * the Free Software Foundation; either version 2 of the License, or
81 * (at your option) any later version.
82 *
83 * This program is distributed in the hope that it will be useful,
84 * but WITHOUT ANY WARRANTY; without even the implied warranty of
85 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
86 * General Public License for more details.
87 *
88 * You should have received a copy of the GNU General Public License
89 * along with this program; if not, write to the Free Software
90 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
91 */ 79 */
92#include <ctype.h> /* isalpha, isdigit */ 80#include <ctype.h> /* isalpha, isdigit */
93#include <unistd.h> /* getpid */ 81#include <unistd.h> /* getpid */
@@ -369,7 +357,7 @@ static int free_pipe(struct pipe *pi, int indent);
369/* really run the final data structures: */ 357/* really run the final data structures: */
370static int setup_redirects(struct child_prog *prog, int squirrel[]); 358static int setup_redirects(struct child_prog *prog, int squirrel[]);
371static int run_list_real(struct pipe *pi); 359static int run_list_real(struct pipe *pi);
372static void pseudo_exec(struct child_prog *child) __attribute__ ((noreturn)); 360static void pseudo_exec(struct child_prog *child) ATTRIBUTE_NORETURN;
373static int run_pipe_real(struct pipe *pi); 361static int run_pipe_real(struct pipe *pi);
374/* extended glob support: */ 362/* extended glob support: */
375static int globhack(const char *src, int flags, glob_t *pglob); 363static int globhack(const char *src, int flags, glob_t *pglob);
diff --git a/shell/lash.c b/shell/lash.c
index f4cadde14..a23f5f4d4 100644
--- a/shell/lash.c
+++ b/shell/lash.c
@@ -8,20 +8,7 @@
8 * under the following liberal license: "We have placed this source code in the 8 * under the following liberal license: "We have placed this source code in the
9 * public domain. Use it in any project, free or commercial." 9 * public domain. Use it in any project, free or commercial."
10 * 10 *
11 * This program is free software; you can redistribute it and/or modify 11 * Licensed under the GPL v2 or later, see the file LICENSE in this tarball.
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 2 of the License, or
14 * (at your option) any later version.
15 *
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 * General Public License for more details.
20 *
21 * You should have received a copy of the GNU General Public License
22 * along with this program; if not, write to the Free Software
23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
24 *
25 */ 12 */
26 13
27/* This shell's parsing engine is officially at a dead-end. Future 14/* This shell's parsing engine is officially at a dead-end. Future
@@ -148,7 +135,7 @@ static void remove_job(struct jobset *j_list, struct job *job);
148static int get_command(FILE * source, char *command); 135static int get_command(FILE * source, char *command);
149static int parse_command(char **command_ptr, struct job *job, int *inbg); 136static int parse_command(char **command_ptr, struct job *job, int *inbg);
150static int run_command(struct job *newjob, int inbg, int outpipe[2]); 137static int run_command(struct job *newjob, int inbg, int outpipe[2]);
151static int pseudo_exec(struct child_prog *cmd) __attribute__ ((noreturn)); 138static int pseudo_exec(struct child_prog *cmd) ATTRIBUTE_NORETURN;
152static int busy_loop(FILE * input); 139static int busy_loop(FILE * input);
153 140
154 141
diff --git a/sysklogd/klogd.c b/sysklogd/klogd.c
index e4c8a630e..b8d69c445 100644
--- a/sysklogd/klogd.c
+++ b/sysklogd/klogd.c
@@ -4,7 +4,7 @@
4 * 4 *
5 * Copyright (C) 2001 by Gennady Feldman <gfeldman@gena01.com>. 5 * Copyright (C) 2001 by Gennady Feldman <gfeldman@gena01.com>.
6 * Changes: Made this a standalone busybox module which uses standalone 6 * Changes: Made this a standalone busybox module which uses standalone
7 * syslog() client interface. 7 * syslog() client interface.
8 * 8 *
9 * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org> 9 * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
10 * 10 *
@@ -14,20 +14,7 @@
14 * 14 *
15 * Maintainer: Gennady Feldman <gfeldman@gena01.com> as of Mar 12, 2001 15 * Maintainer: Gennady Feldman <gfeldman@gena01.com> as of Mar 12, 2001
16 * 16 *
17 * This program is free software; you can redistribute it and/or modify 17 * Licensed under the GPL v2 or later, see the file LICENSE in this tarball.
18 * it under the terms of the GNU General Public License as published by
19 * the Free Software Foundation; either version 2 of the License, or
20 * (at your option) any later version.
21 *
22 * This program is distributed in the hope that it will be useful,
23 * but WITHOUT ANY WARRANTY; without even the implied warranty of
24 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
25 * General Public License for more details.
26 *
27 * You should have received a copy of the GNU General Public License
28 * along with this program; if not, write to the Free Software
29 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
30 *
31 */ 18 */
32 19
33#include <stdio.h> 20#include <stdio.h>
@@ -51,7 +38,7 @@ static void klogd_signal(int sig)
51 exit(EXIT_SUCCESS); 38 exit(EXIT_SUCCESS);
52} 39}
53 40
54static void doKlogd(const int console_log_level) __attribute__ ((noreturn)); 41static void doKlogd(const int console_log_level) ATTRIBUTE_NORETURN;
55static void doKlogd(const int console_log_level) 42static void doKlogd(const int console_log_level)
56{ 43{
57 int priority = LOG_INFO; 44 int priority = LOG_INFO;
diff --git a/sysklogd/syslogd.c b/sysklogd/syslogd.c
index 3d94069e2..e6b7ee7ed 100644
--- a/sysklogd/syslogd.c
+++ b/sysklogd/syslogd.c
@@ -10,20 +10,7 @@
10 * 10 *
11 * Maintainer: Gennady Feldman <gfeldman@gena01.com> as of Mar 12, 2001 11 * Maintainer: Gennady Feldman <gfeldman@gena01.com> as of Mar 12, 2001
12 * 12 *
13 * This program is free software; you can redistribute it and/or modify 13 * Licensed under the GPL v2 or later, see the file LICENSE in this tarball.
14 * it under the terms of the GNU General Public License as published by
15 * the Free Software Foundation; either version 2 of the License, or
16 * (at your option) any later version.
17 *
18 * This program is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
21 * General Public License for more details.
22 *
23 * You should have received a copy of the GNU General Public License
24 * along with this program; if not, write to the Free Software
25 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
26 *
27 */ 14 */
28 15
29#include <stdio.h> 16#include <stdio.h>
@@ -527,7 +514,7 @@ static int serveConnection(char *tmpbuf, int n_read)
527 return n_read; 514 return n_read;
528} 515}
529 516
530static void doSyslogd(void) __attribute__ ((noreturn)); 517static void doSyslogd(void) ATTRIBUTE_NORETURN;
531static void doSyslogd(void) 518static void doSyslogd(void)
532{ 519{
533 struct sockaddr_un sunx; 520 struct sockaddr_un sunx;
diff --git a/util-linux/fdisk.c b/util-linux/fdisk.c
index eec82a6be..6edf9c31e 100644
--- a/util-linux/fdisk.c
+++ b/util-linux/fdisk.c
@@ -2,10 +2,7 @@
2 * 2 *
3 * Copyright (C) 1992 A. V. Le Blanc (LeBlanc@mcc.ac.uk) 3 * Copyright (C) 1992 A. V. Le Blanc (LeBlanc@mcc.ac.uk)
4 * 4 *
5 * This program is free software. You can redistribute it and/or 5 * Licensed under the GPL v1 or later, see the file LICENSE in this tarball.
6 * modify it under the terms of the GNU General Public License as
7 * published by the Free Software Foundation: either version 1 or
8 * (at your option) any later version.
9 * 6 *
10 * Vladimir Oleynik <dzo@simtreas.ru> 2001,2002 Busybox port 7 * Vladimir Oleynik <dzo@simtreas.ru> 2001,2002 Busybox port
11 */ 8 */
@@ -200,7 +197,7 @@ struct partition {
200 unsigned char end_cyl; /* end cylinder */ 197 unsigned char end_cyl; /* end cylinder */
201 unsigned char start4[4]; /* starting sector counting from 0 */ 198 unsigned char start4[4]; /* starting sector counting from 0 */
202 unsigned char size4[4]; /* nr of sectors in partition */ 199 unsigned char size4[4]; /* nr of sectors in partition */
203} __attribute__((__packed__)); 200} ATTRIBUTE_PACKED;
204 201
205enum failure { 202enum failure {
206 ioctl_error, unable_to_open, unable_to_read, unable_to_seek, 203 ioctl_error, unable_to_open, unable_to_read, unable_to_seek,
@@ -224,7 +221,7 @@ static void list_types(const struct systypes *sys);
224static uint read_int(uint low, uint dflt, uint high, uint base, char *mesg); 221static uint read_int(uint low, uint dflt, uint high, uint base, char *mesg);
225#endif 222#endif
226static const char *partition_type(unsigned char type); 223static const char *partition_type(unsigned char type);
227static void fdisk_fatal(enum failure why) __attribute__ ((noreturn)); 224static void fdisk_fatal(enum failure why) ATTRIBUTE_NORETURN;
228static void get_geometry(void); 225static void get_geometry(void);
229static int get_boot(enum action what); 226static int get_boot(enum action what);
230 227
diff --git a/util-linux/fsck_minix.c b/util-linux/fsck_minix.c
index f6d7deaab..1814537c5 100644
--- a/util-linux/fsck_minix.c
+++ b/util-linux/fsck_minix.c
@@ -269,7 +269,7 @@ static inline int bit(char * a,unsigned int i)
269#define mark_zone(x) (setbit(zone_map,(x)-FIRSTZONE+1),changed=1) 269#define mark_zone(x) (setbit(zone_map,(x)-FIRSTZONE+1),changed=1)
270#define unmark_zone(x) (clrbit(zone_map,(x)-FIRSTZONE+1),changed=1) 270#define unmark_zone(x) (clrbit(zone_map,(x)-FIRSTZONE+1),changed=1)
271 271
272static void leave(int) __attribute__ ((noreturn)); 272static void leave(int) ATTRIBUTE_NORETURN;
273static void leave(int status) 273static void leave(int status)
274{ 274{
275 if (termios_set) 275 if (termios_set)