bugTiny C Compiler - Bugs: bug #61587, compilation of gnulib's regex.c...

 
 

bug #61587: compilation of gnulib's regex.c failed, seemingly due to unsupported VLA

Submitter:  Benno Schulenberg <bens>
Submitted:  Tue 30 Nov 2021 01:29:19 PM UTC
   
 
Category:  None Severity:  3 - Normal
Item Group:  None Status:  None
Privacy:  Public Assigned to:  None
Open/Closed:  Open
* Mandatory Fields

Add a New Comment Rich Markup
   

Tue 29 Nov 2022 05:56:23 PM UTC, comment #2: 

We added VLA support some time ago.
Can you try the lastest version at:
git clone git://repo.or.cz/tinycc.git

Herman ten Brugge <hermantb>
Tue 30 Nov 2021 09:13:26 PM UTC, comment #1: 

original submission:

> Maybe the default value for _STDC_VERSION_ should become 201112L?  Another suggested fix would be to predefine _STDC_NO_VLA_ to 1

Defining _STDC_VERSION_ to 1 would not suffice, since C11 requires support for VLAs unless the compiler defines _STDC_NO_VLA_ to 1. So you'd also need to define _STDC_NO_VLA_.

I just now looked, and this VLA bug was reported on the tinycc-devel mailing list 3 months ago. It appears that the intended fix is to not mess with _STDC_VERSION_ or with _STDC_NO_VLA_, and to instead fix the bug with VLAs.

Paul Eggert <eggert>
Tue 30 Nov 2021 01:29:19 PM UTC, original submission:  

Tcc defines _STDC_VERSION_ to 199901L by default even though it does not seem to support VLA fully.  Trying to compile the regex module from gnulib (after commit 56b32251 from two months ago) fails like this [see 1]:

tcc -DHAVE_CONFIG_H -I. -I..   -D_GNU_SOURCE -D_DEFAULT_SOURCE
-I/usr/include/ncursesw   -g -O2 -Wall -c -o regex.o regex.c
In file included from regex.c:70:
./regex.h:682: error: '__nmatch' undeclared

(Compilation succeeds with current gnulib because a workaround was installed in commit b9c0c4a7.)

Maybe the default value for _STDC_VERSION_ should become 201112L?  Another suggested fix would be to predefine _STDC_NO_VLA_ to 1 [see 2].

[1] https://lists.gnu.org/archive/html/bug-gnulib/2021-11/msg00038.html
[2] https://lists.gnu.org/archive/html/bug-gnulib/2021-11/msg00039.html.

Benno Schulenberg <bens>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by hermantb (Posted a comment)
  • -email is unavailable- added by eggert (Posted a comment)
  • -email is unavailable- added by bens (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    No changes have been made to this item

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code