Re: [Tinycc-devel] possible minor changes to code

2014-03-08 Thread Thomas Preud'homme
Le mardi 4 mars 2014, 06:27:37 Carlos Montiers a écrit :
 Hello. I check the tiny c project with cppcheck, and i found this next:
 
 tiny_impdef.c line 228
 p = tcc_realloc(p, n0 = n0 ? n0 * 2 : 256);
 maybe should be:
 p = tcc_realloc(p, n0 ? n0 * 2 : 256);

If you check the source you'll see that it's probably made on purpose since 
this is part of a loop and thus n0 will be used again later. Agreed, the n0 = 
n0 ? n0 * 2 : 256 could be done outside realloc but there is no problem here.

 
 x86_64-gen.c line 504
 assert((v = TREG_XMM0) || (v = TREG_XMM7));
 maybe should be:
 assert((v = TREG_XMM0)  (v = TREG_XMM7));

Looks weird indeed. It seems the problem was introduced in 1caee8ab. Fixed.

 
 tccgen.c line 2272
 if (t  (VT_DEFSIGN | VT_UNSIGNED))
 maybe should be:
 if (t  VT_UNSIGNED)

No problem here, I don't see why it complains.

 
 tccgen.c line 165
 s = *ps;
 maybe should be:
 //s = *ps; because is assigned in next line

Oups, my fault. I guess it's some leftover from statement I added to do a 
patch. Fixed.

 
 tccpp.c line 2917
 assign address of local variable to a function parameter (i not understand
 this), but for case

We change the value of a function parameter and the tool complains because 
function parameters are passed by value and this assignment will be lost. 
However here the parameter is reused later so the value is not lost. False 
warning.

 
 tccpp.c line 279
 sprintf(p, %Lu, cv-ull);
 maybe should be: //the mask is unsigned long but the value is unsigned long
 long
 sprintf(p, %llu, cv-ull);
 or
 sprintf(p, %Lu, (unsigned long)cv-ull);

Fixed.

 
 c67-gen.c lines 1904 and 1905 are unncesseary because are the same
 condition that lines 1902 and 1903

Fixed. Strange, because it seems it was written directly like this.

 
 tcc.c line 82
 int ret = spawnvp(P_NOWAIT, prog, (char *const*)argv);
 maybe should be: //because spawnvp spect (const char * const *)
 int ret = spawnvp(P_NOWAIT, prog, (const char * const *)argv);

I prefer to leave it untouched as I don't see where it finds this signature for 
spawnvp. I found the prototype in win32/include/process.h but it's only char * 
const [] (the const seems redundant since an array cannot be modified).

Thanks for your report.

Cheers

Thomas

___
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel


Re: [Tinycc-devel] please ignore execvl issure ...

2014-03-08 Thread Thomas Preud'homme
Le mercredi 5 mars 2014, 13:13:43 z_axis a écrit :
 In file included from /usr/include/signal.h:38:
 In file included from /usr/include/sys/signal.h:46:
 /usr/include/machine/signal.h:119: error: ',' expected (got __aligned)

I tried with your code and I don't have this error. Which version of tcc are 
you using? Could you give us the preprocessed file as output by tcc -E? 

 
 #!tcc -run

How can this even run? You should give the complete path to tcc.

Best regards,

Thomas

___
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel


Re: [Tinycc-devel] please ignore execvl issure ...

2014-03-08 Thread z_axis









在 2014-03-08 18:44:06,Thomas Preud'homme robo...@celest.fr 写道:
Le mercredi 5 mars 2014, 13:13:43 z_axis a écrit :
 In file included from /usr/include/signal.h:38:
 In file included from /usr/include/sys/signal.h:46:
 /usr/include/machine/signal.h:119: error: ',' expected (got __aligned)

I tried with your code and I don't have this error. Which version of tcc are 
you using? Could you give us the preprocessed file as output by tcc -E? 

 
 #!tcc -run

How can this even run? You should give the complete path to tcc.

Best regards,

Thomas


wmi.c-E
Description: Binary data
___
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel


[Tinycc-devel] tcc compile broken with clang-3.3 (regression from 0.9.26)

2014-03-08 Thread Austin English
It broke between 0.9.25 and 0.9.26. Introduced by:
7a477d70cabe15fa66fd0f32fab5e95841a500e5 is the first bad commit
commit 7a477d70cabe15fa66fd0f32fab5e95841a500e5
Author: grischka grischka
Date:   Wed Feb 6 19:01:07 2013 +0100

lib/Makefile: use CC, add bcheck to libtcc1.a

Also:
- fix make tcc_p (profiling version)
- remove old gcc flags:
  -mpreferred-stack-boundary=2 -march=i386 -falign-functions=0
- remove test hello for Darwin (cannot compile to file)

[austin@localhost tinycc]$ git describe
release_0_9_26-158-gfdb3b10

clang -c libtcc1.c -o x86_64/libtcc1.o -I..  -Wall -g -O2
-fheinous-gnu-extensions -DTCC_TARGET_X86_64
libtcc1.c:697:45: error: too few arguments provided to function-like macro
invocation
void *__va_copy(struct __va_list_struct *src)
^
/usr/bin/../lib/clang/3.3/include/stdarg.h:40:9: note: macro '__va_copy'
defined here
#define __va_copy(d,s) __builtin_va_copy(d,s)
^
libtcc1.c:697:16: error: expected ';' after top level declarator
void *__va_copy(struct __va_list_struct *src)
   ^
   ;
2 errors generated.
make[1]: *** [x86_64/libtcc1.o] Error 1

[austin@localhost tinycc]$ clang --version
clang version 3.3 (tags/RELEASE_33/final)
Target: x86_64-redhat-linux-gnu
Thread model: posix

Hopefully enough time to fix it for 0.9.27 ;)

-- 
-Austin
___
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel