Mercurial > hg > octave-kai > gnulib-hg
annotate lib/error.h @ 411:19dca1d4d7f6
Use __-protected versions of `format' and `printf' only with gcc-2.7 and later.
author | Jim Meyering <jim@meyering.net> |
---|---|
date | Thu, 27 Apr 1995 17:04:23 +0000 (1995-04-27) |
parents | 746d00bc937d |
children | 79626753a234 |
rev | line source |
---|---|
402 | 1 /* error.h -- declaration for error-reporting function |
2 Copyright (C) 1995 Software Foundation, Inc. | |
3 | |
4 This program is free software; you can redistribute it and/or modify | |
5 it under the terms of the GNU General Public License as published by | |
6 the Free Software Foundation; either version 2, or (at your option) | |
7 any later version. | |
8 | |
9 This program is distributed in the hope that it will be useful, | |
10 but WITHOUT ANY WARRANTY; without even the implied warranty of | |
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
12 GNU General Public License for more details. | |
13 | |
14 You should have received a copy of the GNU General Public License | |
15 along with this program; if not, write to the Free Software | |
16 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ | |
17 | |
367 | 18 #ifndef _error_h_ |
19 #define _error_h_ | |
20 | |
403
fae5c15f7778
Fix mostly per Franc,ois' suggestions.
Jim Meyering <jim@meyering.net>
parents:
402
diff
changeset
|
21 #ifndef __attribute__ |
411
19dca1d4d7f6
Use __-protected versions of `format' and `printf' only with gcc-2.7 and later.
Jim Meyering <jim@meyering.net>
parents:
404
diff
changeset
|
22 /* This feature is available in gcc versions 2.5 and later. */ |
403
fae5c15f7778
Fix mostly per Franc,ois' suggestions.
Jim Meyering <jim@meyering.net>
parents:
402
diff
changeset
|
23 # if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5) || __STRICT_ANSI__ |
fae5c15f7778
Fix mostly per Franc,ois' suggestions.
Jim Meyering <jim@meyering.net>
parents:
402
diff
changeset
|
24 # define __attribute__(Spec) /* empty */ |
fae5c15f7778
Fix mostly per Franc,ois' suggestions.
Jim Meyering <jim@meyering.net>
parents:
402
diff
changeset
|
25 # endif |
411
19dca1d4d7f6
Use __-protected versions of `format' and `printf' only with gcc-2.7 and later.
Jim Meyering <jim@meyering.net>
parents:
404
diff
changeset
|
26 /* The __-protected variants of `format' and `printf' attributes |
19dca1d4d7f6
Use __-protected versions of `format' and `printf' only with gcc-2.7 and later.
Jim Meyering <jim@meyering.net>
parents:
404
diff
changeset
|
27 are accepted by gcc versions 2.6.4 (effectively 2.7) and later. */ |
19dca1d4d7f6
Use __-protected versions of `format' and `printf' only with gcc-2.7 and later.
Jim Meyering <jim@meyering.net>
parents:
404
diff
changeset
|
28 # if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7) |
19dca1d4d7f6
Use __-protected versions of `format' and `printf' only with gcc-2.7 and later.
Jim Meyering <jim@meyering.net>
parents:
404
diff
changeset
|
29 # define __format__ format |
19dca1d4d7f6
Use __-protected versions of `format' and `printf' only with gcc-2.7 and later.
Jim Meyering <jim@meyering.net>
parents:
404
diff
changeset
|
30 # define __printf__ printf |
19dca1d4d7f6
Use __-protected versions of `format' and `printf' only with gcc-2.7 and later.
Jim Meyering <jim@meyering.net>
parents:
404
diff
changeset
|
31 # endif |
367 | 32 #endif |
402 | 33 |
403
fae5c15f7778
Fix mostly per Franc,ois' suggestions.
Jim Meyering <jim@meyering.net>
parents:
402
diff
changeset
|
34 #if __STDC__ |
fae5c15f7778
Fix mostly per Franc,ois' suggestions.
Jim Meyering <jim@meyering.net>
parents:
402
diff
changeset
|
35 void error (int, int, const char *, ...) \ |
404
746d00bc937d
Protect format and printf with __*__.
Jim Meyering <jim@meyering.net>
parents:
403
diff
changeset
|
36 __attribute__ ((__format__ (__printf__, 3, 4))); |
367 | 37 #else |
38 void error (); | |
39 #endif | |
40 | |
41 #endif /* _error_h_ */ |