tinycc-devel
[Top][All Lists]
Advanced

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

Re: [Tinycc-devel] Several patchs from Debian packaging


From: RoboTux
Subject: Re: [Tinycc-devel] Several patchs from Debian packaging
Date: Tue, 20 Apr 2010 16:14:11 +0200
User-agent: KMail/1.12.4 (Linux/2.6.32-3-amd64; KDE/4.3.4; x86_64; ; )

Le dimanche 18 avril 2010 22:31:29, grischka a écrit :
[SNIP]
> 
> I'd propose to write a function such as:
> 
> char *tcc_strcpy_part(char *out, const char *in, size_t num)
> {
>      memcpy(out, in, num);
>      out[num] = 0;
>      return out;
> }
> 
> Such your code will be shorter and the new function can be used
> elsewhere too (e.g. in tok_alloc_new)
For the moment I just created the function in tccelf.c so that the only change 
the patch introduces are about the ld script handling.
> 
> > for the 3 tests (minus the - 3 for the ".def" comparison when
> > TCC_TARGET_PE is defined).
> >
> > I also wonder wether is strncmp is a good idea here as it could match
> > .sowtf
> 
> I don't understand ".sowtf" but strncmp is almost never a good idea ;)

I mean .so<anything> (that is a file that match ".so" regex instead of ".so$".
> 
> >>> [P|e9406c0] Complain for static fct declared w/o file scope
> >>> Error out on static function without file scope and give an
> >>> explaination to the user
> >>
> >> Probably too correct.  It's not an error with GCC and also breaks
> >> compilation of some older code I use for testing.
> >
> > Could you provide me an example where this is the case ? (Cf my previous
> > answer)
> 
> Appears it was not an error in GCC 3.x but is one in GCC 4.x.  Maybe
> we could make it just a warning for now.  Do what you want ;)
I suggest to leave it like this as defining in a file scope a static function 
declared within a block fails to compile. In that case I'd personally prefer 
to have an error than just a warning and trying to understand what could be 
the compilation error.

I also changed the load/save_buffer_state horrible hack into a dynarray 
approach. Take a look at the code, I'm sure you'll be happy with it. See 
commits 3ad3168 (for the ldscript cleaning) and 4d5fcfb (about unused 
vtop_saved from the sizeof patch).

Best regards,

> 
> --- grischka
> 

Thomas preud'homme

Attachment: signature.asc
Description: This is a digitally signed message part.


reply via email to

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