summaryrefslogtreecommitdiff
path: root/bin/ksh
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>2004-12-18 22:42:27 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>2004-12-18 22:42:27 +0000
commit8677fe28d1be552d8ed7fe8a200da3c727ec41ff (patch)
treeab5c11d6463dcc4f3decfa0aa002fc8e9a5a2b2d /bin/ksh
parentb277f4142edf5132e56ad2e197b0cd4ec79fa9b6 (diff)
remove GCC_FUNC_ATTR/GCC_FUNC_ATTR2 and just use __attribute__ directly
(we define it away in sys/cdefs.h if it is not supported).
Diffstat (limited to 'bin/ksh')
-rw-r--r--bin/ksh/config.h17
-rw-r--r--bin/ksh/expr.c4
-rw-r--r--bin/ksh/proto.h22
-rw-r--r--bin/ksh/syn.c7
4 files changed, 17 insertions, 33 deletions
diff --git a/bin/ksh/config.h b/bin/ksh/config.h
index 3cd16b86e23..3da1235dc76 100644
--- a/bin/ksh/config.h
+++ b/bin/ksh/config.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: config.h,v 1.12 2004/12/18 21:04:52 millert Exp $ */
+/* $OpenBSD: config.h,v 1.13 2004/12/18 22:42:26 millert Exp $ */
/* config.h. NOT generated automatically. */
@@ -11,13 +11,6 @@
#ifndef CONFIG_H
#define CONFIG_H
-
-
-
-/* Define if C compiler groks __attribute__((...)) (const, noreturn, format) */
-#define HAVE_GCC_FUNC_ATTR 1
-
-
/* Include emacs editing? */
#define EMACS 1
@@ -67,12 +60,4 @@
# define HISTORY
#endif /* EDIT */
-#ifdef HAVE_GCC_FUNC_ATTR
-# define GCC_FUNC_ATTR(x) __attribute__((x))
-# define GCC_FUNC_ATTR2(x,y) __attribute__((x,y))
-#else
-# define GCC_FUNC_ATTR(x)
-# define GCC_FUNC_ATTR2(x,y)
-#endif /* HAVE_GCC_FUNC_ATTR */
-
#endif /* CONFIG_H */
diff --git a/bin/ksh/expr.c b/bin/ksh/expr.c
index 382c27e6dec..57b254183be 100644
--- a/bin/ksh/expr.c
+++ b/bin/ksh/expr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: expr.c,v 1.12 2004/12/18 21:25:44 millert Exp $ */
+/* $OpenBSD: expr.c,v 1.13 2004/12/18 22:42:26 millert Exp $ */
/*
* Korn expression evaluation
@@ -129,7 +129,7 @@ enum error_type { ET_UNEXPECTED, ET_BADLIT, ET_RECURSIVE,
ET_LVALUE, ET_RDONLY, ET_STR };
static void evalerr(Expr_state *es, enum error_type type,
- const char *str) GCC_FUNC_ATTR(noreturn);
+ const char *str) __attribute__((__noreturn__));
static struct tbl *evalexpr(Expr_state *es, enum prec prec);
static void token(Expr_state *es);
static struct tbl *do_ppmm(Expr_state *es, enum token op,
diff --git a/bin/ksh/proto.h b/bin/ksh/proto.h
index d03762ef082..bb05202e3d5 100644
--- a/bin/ksh/proto.h
+++ b/bin/ksh/proto.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: proto.h,v 1.18 2004/12/18 22:35:41 millert Exp $ */
+/* $OpenBSD: proto.h,v 1.19 2004/12/18 22:42:26 millert Exp $ */
/*
* prototypes for PD-KSH
@@ -98,22 +98,22 @@ char **hist_get_newest(int allow_cur);
#endif /* HISTORY */
/* io.c */
void errorf(const char *fmt, ...)
- GCC_FUNC_ATTR2(noreturn, format(printf, 1, 2));
+ __attribute__((__noreturn__, __format__ (printf, 1, 2)));
void warningf(int fileline, const char *fmt, ...)
- GCC_FUNC_ATTR(format(printf, 2, 3));
+ __attribute__((__format__ (printf, 2, 3)));
void bi_errorf(const char *fmt, ...)
- GCC_FUNC_ATTR(format(printf, 1, 2));
+ __attribute__((__format__ (printf, 1, 2)));
void internal_errorf(int jump, const char *fmt, ...)
- GCC_FUNC_ATTR(format(printf, 2, 3));
+ __attribute__((__format__ (printf, 2, 3)));
void error_prefix(int fileline);
void shellf(const char *fmt, ...)
- GCC_FUNC_ATTR(format(printf, 1, 2));
+ __attribute__((__format__ (printf, 1, 2)));
void shprintf(const char *fmt, ...)
- GCC_FUNC_ATTR(format(printf, 1, 2));
+ __attribute__((__format__ (printf, 1, 2)));
#ifdef KSH_DEBUG
void kshdebug_init_(void);
void kshdebug_printf_(const char *fmt, ...)
- GCC_FUNC_ATTR(format(printf, 1, 2));
+ __attribute__((__format__ (printf, 1, 2)));
void kshdebug_dump_(const char *str, const void *mem, int nbytes);
#endif /* KSH_DEBUG */
int can_seek(int fd);
@@ -149,7 +149,7 @@ int j_stopped_running(void);
/* lex.c */
int yylex(int cf);
void yyerror(const char *fmt, ...)
- GCC_FUNC_ATTR2(noreturn, format(printf, 1, 2));
+ __attribute__((__noreturn__, __format__ (printf, 1, 2)));
Source * pushs(int type, Area *areap);
void set_prompt(int to, Source *s);
void pprompt(const char *cp, int ntruncate);
@@ -162,13 +162,13 @@ void mpset(char *mptoparse);
int include(const char *name, int argc, char **argv, int intr_ok);
int command(const char *comm);
int shell(Source *volatile s, int volatile toplevel);
-void unwind(int i) GCC_FUNC_ATTR(noreturn);
+void unwind(int i) __attribute__((__noreturn__));
void newenv(int type);
void quitenv(void);
void cleanup_parents_env(void);
void cleanup_proc_env(void);
void aerror(Area *ap, const char *msg)
- GCC_FUNC_ATTR(noreturn);
+ __attribute__((__noreturn__));
/* misc.c */
void setctypes(const char *s, int t);
void initctypes(void);
diff --git a/bin/ksh/syn.c b/bin/ksh/syn.c
index 6204e006f31..2d1ed02536c 100644
--- a/bin/ksh/syn.c
+++ b/bin/ksh/syn.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: syn.c,v 1.17 2004/12/18 21:25:44 millert Exp $ */
+/* $OpenBSD: syn.c,v 1.18 2004/12/18 22:42:26 millert Exp $ */
/*
* shell parser (C version)
@@ -27,11 +27,10 @@ static struct op *caselist(void);
static struct op *casepart(int endtok);
static struct op *function_body(char *name, int ksh_func);
static char ** wordlist(void);
-static struct op *block(int type, struct op *t1, struct op *t2,
- char **wp);
+static struct op *block(int type, struct op *t1, struct op *t2, char **wp);
static struct op *newtp(int type);
static void syntaxerr(const char *what)
- GCC_FUNC_ATTR(noreturn);
+ __attribute__((__noreturn__));
static void nesting_push(struct nesting_state *save, int tok);
static void nesting_pop(struct nesting_state *saved);
static int assign_command(char *s);