|
From: | Marc Andre Tanner |
Subject: | Re: [Tinycc-devel] New fun bug! #include <regex.h> |
Date: | Fri, 21 Sep 2007 10:02:19 +0200 |
User-agent: | Thunderbird 2.0.0.6 (Windows/20070728) |
Rob Landley wrote:
On Thursday 20 September 2007 4:00:33 pm Marc Andre Tanner wrote:And since recent tcc sets __STDC_VERSION__ to 199901L __restrict_arr is defined as restrict which causes the problem because tcc doesn't know how to handle this.gcc doesn't know how to handle this either. If I save the tcc -E output and then feed it to gcc, gcc dies at the exact same point with an equivalent error.
Yes, but if you run gcc -E this results in: regmatch_t __pmatch[__restrict]
tcc knows how to handle restrict when it's applied in other contexts, but in this context it seems to make about as much sense as "int array[long];"
According to the comment in sys/cdefs.h this is valid C99 don't know whether this is true or not.
/* ISO C99 also allows to declare arrays as non-overlapping. The syntax is array_name[restrict] GCC 3.1 supports this. */
I notice that the test here is 199901L <= __STDC_VERSION__ and the earlier test was >=, and when they're == it gets _confused_... I'm going to bed now. Fixit in the morning...Did you actually fix it?Nope, because I'm not quite sure how I should.This is either a bug in the glibc headers, or it's a bug in the #defines were setting. I'm strongly leaning towards the first, but would love to come up with a workaround...Because in todays tip the issue was still present. Anyway i have attached my attempt to fix the problem, the patchmakes tcc ignore array definitions containing restrict as found in regex.h. So the following should now be parseable without an error.Hmmm... Well, it's small enough to be a usable workaround, anyway. I'll poke at it tonight...
Thanks
Rob
Marc -- Marc Andre Tanner >< http://www.brain-dump.org/ >< GPG key: CF7D56C0
[Prev in Thread] | Current Thread | [Next in Thread] |