fixed const and volatile function parameters typing - fixed string parsing when skipping code
This commit is contained in:
6
tcc.c
6
tcc.c
@ -2061,7 +2061,8 @@ static uint8_t *parse_pp_string(uint8_t *p,
|
|||||||
} else if (c == '\r') {
|
} else if (c == '\r') {
|
||||||
PEEKC_EOB(c, p);
|
PEEKC_EOB(c, p);
|
||||||
if (c != '\n') {
|
if (c != '\n') {
|
||||||
cstr_ccat(str, '\r');
|
if (str)
|
||||||
|
cstr_ccat(str, '\r');
|
||||||
} else {
|
} else {
|
||||||
file->line_num++;
|
file->line_num++;
|
||||||
goto add_char;
|
goto add_char;
|
||||||
@ -6621,6 +6622,9 @@ the_end:
|
|||||||
function pointer) */
|
function pointer) */
|
||||||
static inline void convert_parameter_type(CType *pt)
|
static inline void convert_parameter_type(CType *pt)
|
||||||
{
|
{
|
||||||
|
/* remove const and volatile qualifiers (XXX: const could be used
|
||||||
|
to indicate a const function parameter */
|
||||||
|
pt->t &= ~(VT_CONSTANT | VT_VOLATILE);
|
||||||
/* array must be transformed to pointer according to ANSI C */
|
/* array must be transformed to pointer according to ANSI C */
|
||||||
pt->t &= ~VT_ARRAY;
|
pt->t &= ~VT_ARRAY;
|
||||||
if ((pt->t & VT_BTYPE) == VT_FUNC) {
|
if ((pt->t & VT_BTYPE) == VT_FUNC) {
|
||||||
|
|||||||
Reference in New Issue
Block a user