diff options
author | bde <bde@FreeBSD.org> | 1996-09-14 03:00:32 +0000 |
---|---|---|
committer | bde <bde@FreeBSD.org> | 1996-09-14 03:00:32 +0000 |
commit | 6ed5ccfb8ff780ada625c4ebc1c40ad5d6395e84 (patch) | |
tree | 137a895b2bbf552ac725382b58bbcd9900e55b7a /include | |
parent | 7a2a97d77da0ec8209bd2d8424f56c95a4f837ea (diff) | |
download | FreeBSD-src-6ed5ccfb8ff780ada625c4ebc1c40ad5d6395e84.zip FreeBSD-src-6ed5ccfb8ff780ada625c4ebc1c40ad5d6395e84.tar.gz |
Don't use __dead or __pure in user code. They were obfuscations
for gcc >= 2.5 and no-ops for gcc >= 2.6. Converted to use __dead2
or __pure2 where it wasn't already done, except in math.h where use
of __pure was mostly wrong.
Diffstat (limited to 'include')
-rw-r--r-- | include/err.h | 20 | ||||
-rw-r--r-- | include/math.h | 106 | ||||
-rw-r--r-- | include/setjmp.h | 3 | ||||
-rw-r--r-- | include/stdlib.h | 18 | ||||
-rw-r--r-- | include/unistd.h | 6 |
5 files changed, 75 insertions, 78 deletions
diff --git a/include/err.h b/include/err.h index 2f065e7..fd02a61 100644 --- a/include/err.h +++ b/include/err.h @@ -47,16 +47,16 @@ #include <sys/cdefs.h> __BEGIN_DECLS -__dead void err __P((int, const char *, ...)) __dead2; -__dead void verr __P((int, const char *, _BSD_VA_LIST_)) __dead2; -__dead void errx __P((int, const char *, ...)) __dead2; -__dead void verrx __P((int, const char *, _BSD_VA_LIST_)) __dead2; -void warn __P((const char *, ...)); -void vwarn __P((const char *, _BSD_VA_LIST_)); -void warnx __P((const char *, ...)); -void vwarnx __P((const char *, _BSD_VA_LIST_)); -void err_set_file __P((void *)); -void err_set_exit __P((void (*)__P((int)))); +void err __P((int, const char *, ...)) __dead2; +void verr __P((int, const char *, _BSD_VA_LIST_)) __dead2; +void errx __P((int, const char *, ...)) __dead2; +void verrx __P((int, const char *, _BSD_VA_LIST_)) __dead2; +void warn __P((const char *, ...)); +void vwarn __P((const char *, _BSD_VA_LIST_)); +void warnx __P((const char *, ...)); +void vwarnx __P((const char *, _BSD_VA_LIST_)); +void err_set_file __P((void *)); +void err_set_exit __P((void (*)(int))); __END_DECLS #endif /* !_ERR_H_ */ diff --git a/include/math.h b/include/math.h index 214b80e..c0d1ddd 100644 --- a/include/math.h +++ b/include/math.h @@ -72,61 +72,69 @@ #include <sys/cdefs.h> +/* + * Most of these functions have the side effect of setting errno, except + * in the (broken) BSD libm, so they not declared as __pure2. + */ __BEGIN_DECLS -__pure double acos __P((double)); -__pure double asin __P((double)); -__pure double atan __P((double)); -__pure double atan2 __P((double, double)); -__pure double ceil __P((double)); -__pure double cos __P((double)); -__pure double cosh __P((double)); -__pure double exp __P((double)); -__pure double fabs __P((double)); -__pure double floor __P((double)); -__pure double fmod __P((double, double)); - double frexp __P((double, int *)); -__pure double ldexp __P((double, int)); -__pure double log __P((double)); -__pure double log10 __P((double)); - double modf __P((double, double *)); -__pure double pow __P((double, double)); -__pure double sin __P((double)); -__pure double sinh __P((double)); -__pure double sqrt __P((double)); -__pure double tan __P((double)); -__pure double tanh __P((double)); +double acos __P((double)); +double asin __P((double)); +double atan __P((double)); +double atan2 __P((double, double)); +double ceil __P((double)); +double cos __P((double)); +double cosh __P((double)); +double exp __P((double)); +double fabs __P((double)); +double floor __P((double)); +double fmod __P((double, double)); +double frexp __P((double, int *)); /* fundamentally !__pure2 */ +double ldexp __P((double, int)); +double log __P((double)); +double log10 __P((double)); +double modf __P((double, double *)); /* fundamentally !__pure2 */ +double pow __P((double, double)); +double sin __P((double)); +double sinh __P((double)); +double sqrt __P((double)); +double tan __P((double)); +double tanh __P((double)); +/* + * These functions are non-ANSI so they can be "right". The ones that + * don't set errno in [lib]msun are declared as __pure2. + */ #if !defined(_ANSI_SOURCE) && !defined(_POSIX_SOURCE) -__pure double acosh __P((double)); -__pure double asinh __P((double)); -__pure double atanh __P((double)); - double cabs(); /* we can't describe cabs()'s argument properly */ -__pure double cbrt __P((double)); -__pure double copysign __P((double, double)); -__pure double drem __P((double, double)); -__pure double erf __P((double)); -__pure double erfc __P((double)); -__pure double expm1 __P((double)); -__pure int finite __P((double)); -__pure double hypot __P((double, double)); +double acosh __P((double)); +double asinh __P((double)); +double atanh __P((double)); +double cabs(); /* we can't describe cabs()'s argument properly */ +double cbrt __P((double)) __pure2; +double copysign __P((double, double)) __pure2; +double drem __P((double, double)); +double erf __P((double)); +double erfc __P((double)) __pure2; +double expm1 __P((double)) __pure2; +int finite __P((double)) __pure2; +double hypot __P((double, double)); #if defined(vax) || defined(tahoe) -__pure double infnan __P((int)); +double infnan __P((int)); #endif -__pure int isinf __P((double)); -__pure int isnan __P((double)); -__pure double j0 __P((double)); -__pure double j1 __P((double)); -__pure double jn __P((int, double)); -__pure double lgamma __P((double)); -__pure double log1p __P((double)); -__pure double logb __P((double)); -__pure double rint __P((double)); -__pure double scalb __P((double, int)); -__pure double y0 __P((double)); -__pure double y1 __P((double)); -__pure double yn __P((int, double)); +int isinf __P((double)) __pure2; +int isnan __P((double)) __pure2; +double j0 __P((double)); +double j1 __P((double)); +double jn __P((int, double)); +double lgamma __P((double)); +double log1p __P((double)) __pure2; +double logb __P((double)) __pure2; +double rint __P((double)) __pure2; +double scalb __P((double, int)); +double y0 __P((double)); +double y1 __P((double)); +double yn __P((int, double)); #endif __END_DECLS -#endif /* _MATH_H_ */ +#endif /* !_MATH_H_ */ diff --git a/include/setjmp.h b/include/setjmp.h index 89b4e3d..5dcc8ee 100644 --- a/include/setjmp.h +++ b/include/setjmp.h @@ -80,18 +80,15 @@ typedef struct { int _jb[_JBLEN + 1]; } jmp_buf[1]; __BEGIN_DECLS int setjmp __P((jmp_buf)); -__dead void longjmp __P((jmp_buf, int)) __dead2; #ifndef _ANSI_SOURCE int sigsetjmp __P((sigjmp_buf, int)); -__dead void siglongjmp __P((sigjmp_buf, int)) __dead2; #endif /* not ANSI */ #if !defined(_ANSI_SOURCE) && !defined(_POSIX_SOURCE) int _setjmp __P((jmp_buf)); -__dead void _longjmp __P((jmp_buf, int)) __dead2; void longjmperror __P((void)); #endif /* neither ANSI nor POSIX */ diff --git a/include/stdlib.h b/include/stdlib.h index 069656d..840238e 100644 --- a/include/stdlib.h +++ b/include/stdlib.h @@ -80,10 +80,8 @@ extern int __mb_cur_max; #include <sys/cdefs.h> __BEGIN_DECLS -__dead void - abort __P((void)) __dead2; -__pure int - abs __P((int)) __pure2; +void abort __P((void)) __dead2; +int abs __P((int)) __pure2; int atexit __P((void (*)(void))); double atof __P((const char *)); int atoi __P((const char *)); @@ -91,16 +89,12 @@ long atol __P((const char *)); void *bsearch __P((const void *, const void *, size_t, size_t, int (*)(const void *, const void *))); void *calloc __P((size_t, size_t)); -__pure div_t - div __P((int, int)) __pure2; -__dead void - exit __P((int)) __dead2; +div_t div __P((int, int)) __pure2; +void exit __P((int)) __dead2; void free __P((void *)); char *getenv __P((const char *)); -__pure long - labs __P((long)) __pure2; -__pure ldiv_t - ldiv __P((long, long)) __pure2; +long labs __P((long)) __pure2; +ldiv_t ldiv __P((long, long)) __pure2; void *malloc __P((size_t)); void qsort __P((void *, size_t, size_t, int (*)(const void *, const void *))); diff --git a/include/unistd.h b/include/unistd.h index 8094bd6..7428f5d 100644 --- a/include/unistd.h +++ b/include/unistd.h @@ -49,8 +49,7 @@ #endif __BEGIN_DECLS -__dead void - _exit __P((int)) __dead2; +void _exit __P((int)) __dead2; int access __P((const char *, int)); unsigned int alarm __P((unsigned int)); int chdir __P((const char *)); @@ -121,8 +120,7 @@ int getgrouplist __P((const char *, int, int *, int *)); long gethostid __P((void)); int gethostname __P((char *, int)); mode_t getmode __P((const void *, mode_t)); -__pure int - getpagesize __P((void)); +int getpagesize __P((void)) __pure2; char *getpass __P((const char *)); char *getusershell __P((void)); char *getwd __P((char *)); /* obsoleted by getcwd() */ |