Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Complexified bcopy() check to avoid gcc optimizing it away.

  • Loading branch information...
commit 74d0fe5b3432609a890584aa00bdd6c637a46291 1 parent dc7fd83
Raphael Manfredi authored
Showing with 18 additions and 5 deletions.
  1. +18 −5 Configure
View
23 Configure
@@ -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!!!!!
@@ -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;;
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.