Content-Length: 329732 | pFad | http://github.com/DragonFlyBSD/cpdup/commit/43777c4ec92cef1249f78739dc56a3e80a7a6ab6

AC Fix __printflike/__dead2/etc marcros on Linux · DragonFlyBSD/cpdup@43777c4 · GitHub
Skip to content

Commit 43777c4

Browse files
committed
Fix __printflike/__dead2/etc marcros on Linux
Some of these macros are provided by libbsd, so the old dummy defines were actually causing warnings of 'macro redefined'. Fix and improve the macro definitions.
1 parent 7cd799a commit 43777c4

File tree

1 file changed

+14
-13
lines changed

1 file changed

+14
-13
lines changed

src/cpdup.h

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -24,41 +24,42 @@
2424
#include <fnmatch.h>
2525
#include <assert.h>
2626

27+
#ifdef __linux
28+
2729
/*
28-
* See ./mklinux script
29-
*
3030
* This is a horrible hack. lchmod also seems to be missing
3131
* on the Debian system I am testing compatibility on (which will
3232
* break the symlink handling code), so not sure what to do about
3333
* that.
3434
*
3535
* XXX TODO
3636
*/
37-
#ifdef __linux
38-
39-
#define __printflike(a, b)
40-
#define __printf0like(a, b)
41-
#define __aligned(n)
42-
#define __dead2
43-
#define __unused
44-
4537
#define lchmod chmod /* horrible hack */
4638

47-
#endif
39+
#endif /* __linux */
4840

4941
#define VERSION "1.22"
5042
#define AUTHORS "Matt Dillon, Dima Ruban, & Oliver Fromme"
5143

5244
#ifndef __unused
53-
#define __unused __attribute__((unused))
45+
#define __unused __attribute__((__unused__))
46+
#endif
47+
48+
#ifndef __aligned
49+
#define __aligned(n) __attribute__((__aligned__(n)))
5450
#endif
5551

5652
#ifndef __dead2
5753
#define __dead2 __attribute__((__noreturn__))
5854
#endif
5955

56+
#ifndef __printflike
57+
#define __printflike(a,b) \
58+
__attribute__((__nonnull__(a), __format__(__printf__, a, b)))
59+
#endif
60+
6061
#ifndef __printf0like
61-
#define __printf0like(a,b) __attribute__((__format__ (__printf__, a, b)))
62+
#define __printf0like(a,b) __attribute__((__format__(__printf__, a, b)))
6263
#endif
6364

6465
void logstd(const char *ctl, ...) __printflike(1, 2);

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/DragonFlyBSD/cpdup/commit/43777c4ec92cef1249f78739dc56a3e80a7a6ab6

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy