Skip to content

Commit

Permalink
Complexified bcopy() check to avoid gcc optimizing it away.
Browse files Browse the repository at this point in the history
  • Loading branch information
rmanfredi committed Dec 30, 2011
1 parent dc7fd83 commit 74d0fe5
Showing 1 changed file with 18 additions and 5 deletions.
23 changes: 18 additions & 5 deletions Configure
Expand Up @@ -18,7 +18,7 @@

# $Id: Head.U 41 2010-11-28 00:21:26Z rmanfredi $
#
# Generated on Wed Dec 28 21:59:09 CET 2011 [metaconfig 3.5-109]
# Generated on Fri Dec 30 11:48:34 CET 2011 [metaconfig 3.5-110]

cat >c1$$ <<EOF
ARGGGHHHH!!!!!
Expand Down Expand Up @@ -974,7 +974,7 @@ while test $# -gt 0; do
esac
shift
;;
-V) echo "$me generated by metaconfig 3.5-109." >&2
-V) echo "$me generated by metaconfig 3.5-110." >&2
exit 0;;
--) break;;
-*) echo "$me: unknown option $1" >&2; shift; error=true;;
Expand Down Expand Up @@ -4512,11 +4512,24 @@ eval $trylink
: see if bcopy exists
$cat >try.c <<EOC
#include <strings.h>
static void
init_data(char *a, unsigned len)
{
unsigned i;
for (i = 0; i < len; i++)
a[i] = i * 2 + 1;
}
static void
recopy_data(char *src, char *dst, unsigned len)
{
bcopy(&src[3], &dst[0], len - 3);
}
int main(void)
{
static int src, dst;
bcopy(&src, &dst, sizeof(dst));
return 0;
static char src[20], dst[20];
init_data(src, sizeof src);
recopy_data(src, dst, sizeof src);
return dst[0] + dst[1];
}
EOC
cyn=bcopy
Expand Down

0 comments on commit 74d0fe5

Please sign in to comment.