tinycc-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Tinycc-devel] [PATCH] sinf/sin problem: turn on (by default) implic


From: Thomas Preud'homme
Subject: Re: [Tinycc-devel] [PATCH] sinf/sin problem: turn on (by default) implicit-function-declaration
Date: Sun, 04 Jan 2015 01:09:13 +0000
User-agent: KMail/4.14.1 (Linux/2.6.38-ac2-ac100; KDE/4.14.2; armv7l; ; )

Le samedi 3 janvier 2015, 07:35:46 Sergey Korshunoff a écrit :
> Turn on a implicit-function-declaration warning by default. This could
> help to resolve a problem with sinf/sin

diff -urN tinycc.old/libtcc.c tinycc/libtcc.c
--- tinycc.old/libtcc.c 2015-01-03 06:12:53.000000000 +0300
+++ tinycc/libtcc.c     2015-01-03 07:24:02.000000000 +0300
@@ -1769,6 +1769,9 @@
     CString linker_arg;
     cstr_new(&linker_arg);
 
+    tcc_set_warning(s, "implicit-function-declaration" , 1);
+    // turn it on by default
+
     while (optind < argc) {
 
         r = argv[optind++];

It would be better to add the warning when compiling the tests by changing the 
Makefile. It seems wrong to show a warning when the user didn't ask for one and 
this is consistent with what other compilers do.


diff -urN tinycc.old/tests/tests2/46_grep.c tinycc/tests/tests2/46_grep.c
--- tinycc.old/tests/tests2/46_grep.c   2015-01-03 06:12:53.000000000 +0300
+++ tinycc/tests/tests2/46_grep.c       2015-01-03 07:26:07.000000000 +0300
@@ -16,6 +16,7 @@
  */
 #include <stdio.h>
 #include <stdlib.h>
+#include <ctype.h>     // tolower()
 
 /*
  * grep
diff -urN tinycc.old/tests/tests2/64_macro_nesting.c 
tinycc/tests/tests2/64_macro_nesting.c
--- tinycc.old/tests/tests2/64_macro_nesting.c  2015-01-03 06:12:53.000000000 
+0300
+++ tinycc/tests/tests2/64_macro_nesting.c      2015-01-03 07:29:18.000000000 
+0300
@@ -1,3 +1,5 @@
+#include <stdio.h>     // printf()
+
 #define CAT2(a,b) a##b
 #define CAT(a,b) CAT2(a,b)
 #define AB(x) CAT(x,y)

You can commit these last two changes.

Best regards,

Thomas



reply via email to

[Prev in Thread] Current Thread [Next in Thread]