adapt most __attribute__((…)) occurrences to new KNF style(9)

This commit is contained in:
tg 2013-10-31 20:05:39 +00:00
parent f920d94785
commit cf40c01b45
2 changed files with 8 additions and 8 deletions

View File

@ -1,5 +1,5 @@
#!/bin/sh
srcversion='$MirOS: src/bin/mksh/Build.sh,v 1.647 2013/09/10 17:32:56 tg Exp $'
srcversion='$MirOS: src/bin/mksh/Build.sh,v 1.648 2013/10/31 20:05:38 tg Exp $'
#-
# Copyright (c) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
# 2011, 2012, 2013
@ -1356,8 +1356,8 @@ ac_test attribute_bounded '' 'for __attribute__((__bounded__))' <<-'EOF'
#include <string.h>
#undef __attribute__
int xcopy(const void *, void *, size_t)
__attribute__((__bounded__ (__buffer__, 1, 3)))
__attribute__((__bounded__ (__buffer__, 2, 3)));
__attribute__((__bounded__(__buffer__, 1, 3)))
__attribute__((__bounded__(__buffer__, 2, 3)));
int main(int ac, char *av[]) { return (xcopy(av[0], av[--ac], 1)); }
int xcopy(const void *s, void *d, size_t n) {
/*
@ -1379,7 +1379,7 @@ ac_test attribute_format '' 'for __attribute__((__format__))' <<-'EOF'
#undef __attribute__
#undef fprintf
extern int fprintf(FILE *, const char *format, ...)
__attribute__((__format__ (__printf__, 2, 3)));
__attribute__((__format__(__printf__, 2, 3)));
int main(int ac, char **av) { return (fprintf(stderr, "%s%d", *av, ac)); }
#endif
EOF
@ -1598,7 +1598,7 @@ else
#define EXTERN
#define MKSH_INCLUDES_ONLY
#include "sh.h"
__RCSID("$MirOS: src/bin/mksh/Build.sh,v 1.647 2013/09/10 17:32:56 tg Exp $");
__RCSID("$MirOS: src/bin/mksh/Build.sh,v 1.648 2013/10/31 20:05:38 tg Exp $");
int main(void) { printf("Hello, World!\n"); return (0); }
EOF
case $cm in

6
sh.h
View File

@ -108,12 +108,12 @@
#undef __attribute__
#if HAVE_ATTRIBUTE_BOUNDED
#define MKSH_A_BOUNDED(x,y,z) __attribute__((__bounded__ (x, y, z)))
#define MKSH_A_BOUNDED(x,y,z) __attribute__((__bounded__(x, y, z)))
#else
#define MKSH_A_BOUNDED(x,y,z) /* nothing */
#endif
#if HAVE_ATTRIBUTE_FORMAT
#define MKSH_A_FORMAT(x,y,z) __attribute__((__format__ (x, y, z)))
#define MKSH_A_FORMAT(x,y,z) __attribute__((__format__(x, y, z)))
#else
#define MKSH_A_FORMAT(x,y,z) /* nothing */
#endif
@ -164,7 +164,7 @@
#endif
#ifdef EXTERN
__RCSID("$MirOS: src/bin/mksh/sh.h,v 1.672 2013/10/09 11:59:29 tg Exp $");
__RCSID("$MirOS: src/bin/mksh/sh.h,v 1.673 2013/10/31 20:05:39 tg Exp $");
#endif
#define MKSH_VERSION "R48 2013/10/08"