[Top][All Lists]

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

[Tinycc-devel] Mis-parse in some situations involving a function pointer

From: Jonathan Newman
Subject: [Tinycc-devel] Mis-parse in some situations involving a function pointer with attributes (breaks SQLite build)
Date: Sun, 22 Jul 2018 21:21:11 +0100

I happened across this issue while trying to build SQLite. I've attached a test case. To summarise:
* Start off with a function pointer, correctly assigned to a function that has attributes, but cast to a void* (or indeed anything except the correct function pointer type)
* Cast this void* to the correct function pointer type, and call it
* Observe that one cast+call syntax works correctly, and another results in a misparse:
* tcc thinks the type of the entire _expression_ (cast+call) is a pointer, instead of the correct return type of the called function (here, an integer).
* gcc happily accepts both syntaxes
* This breaks compilation of the sqlite.c amalgamation, at least on 32-bit windows

The failing syntax is perhaps unusual. It might actually be deliberately unsupported, but in that case:
* sqlite will not build without modifications
* tcc should stop here with an error instead of erroneously treating the _expression_ as a pointer

Hope someone can take a look at this. It can be worked around with some modifications to sqlite.

Attachment: problem.c
Description: Text document

reply via email to

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