aboutsummaryrefslogtreecommitdiff
path: root/conftest.c
diff options
context:
space:
mode:
authorgrischka <grischka>2013-02-14 06:53:07 +0100
committergrischka <grischka>2013-02-14 06:53:07 +0100
commit944627c479f01d919f10f9d9dd807cca43bf7aba (patch)
treea1ff856b8160b50a1d8fab477def8d5f29dafbe5 /conftest.c
parente298f608385d51911184281f1cdb09addc560c59 (diff)
downloadtinycc-944627c479f01d919f10f9d9dd807cca43bf7aba.tar.gz
tinycc-944627c479f01d919f10f9d9dd807cca43bf7aba.tar.bz2
configure: cleanup
- add quotes: eval opt=\"$opt\" - use $source_path/conftest.c for OOT build - add fn_makelink() for OOT build - do not check lddir etc. on Windows/MSYS - formatting config-print.c - rename to conftest.c (for consistency) - change option e to b - change output from that from "yes" to "no" - remove inttypes.h dependency - simpify version output Makefile: - improve GCC warning flag checks tcc.h: - add back default CONFIG_LDDIR - add default CONFIG_TCCDIR also (just for fun) tccpp.c: - fix Christian's last warning tccpp.c: In function ‘macro_subst’: tccpp.c:2803:12: warning: ‘*((void *)&cval+4)’ is used uninitialized in this function [-Wuninitialized] That the change fixes the warning doesn't make sense but anyway. libtcc.c: - tcc_error/warning: print correct source filename/line for token :paste: (also inline :asm:) lddir and multiarch logic still needs fixing.
Diffstat (limited to 'conftest.c')
-rw-r--r--conftest.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/conftest.c b/conftest.c
new file mode 100644
index 0000000..a803bff
--- /dev/null
+++ b/conftest.c
@@ -0,0 +1,31 @@
+#include <stdio.h>
+
+int main(int argc, char *argv[])
+{
+ switch(argc == 2 ? argv[1][0] : 0) {
+#ifdef __GNUC__
+ case 'v':
+ printf("%d\n", __GNUC__);
+ break;
+ case 'm':
+ printf("%d\n", __GNUC_MINOR__);
+ break;
+#else
+ case 'v':
+ case 'm':
+ puts("0");
+ break;
+#endif
+ case 'b':
+ {
+ volatile unsigned foo = 0x01234567;
+ puts(*(unsigned char*)&foo == 0x67 ? "no" : "yes");
+ break;
+ }
+ case -1:
+ /* to test -Wno-unused-result */
+ fread(NULL, 1, 1, NULL);
+ break;
+ }
+ return 0;
+}