-AT_CHECK([$CC $CFLAGS $CPPFLAGS calc.c -o calc], 0, [], [stderr])
-AT_CHECK([if test "$GCC" = yes; then cat stderr; else true; fi])
+# Well, that's only part of the story: some assemblers issue warnings
+# which can be totally useless, and actually polluting. It seems that
+# the best bet be to completely ignore stderr, but to pass -Werror
+# to GCC.
+if test "$GCC" = yes; then
+ CFLAGS="$CFLAGS -Werror"
+fi
+AT_CHECK([$CC $CFLAGS $CPPFLAGS calc.c -o calc], 0, [], [ignore])