tinycc-devel
[Top][All Lists]
Advanced

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

[Tinycc-devel] old nocode_wanted problem


From: Sergey Korshunoff
Subject: [Tinycc-devel] old nocode_wanted problem
Date: Sun, 22 Nov 2015 06:40:04 +0300

Hi all
There may be some other bugs in tcc related to nocode_wanted
Check commit 78c076a70f5
      The following check in tccgen.c is removed
        if (nocode_wanted)
        tcc_error("statement expression in global scope");
    This check is introduced in commit 5bcc3eed7b93 and breaks compilation
    of the linux 2.4.26 kernel.

commit 5bcc3ee
Author: Thomas Preud'homme
    Add some missing nocode_wanted guard

A test program related to this issue:
=========================
typedef unsigned int __u32;
struct romfs_super_block {
        __u32 word0;
        __u32 word1;
        __u32 size;
        __u32 checksum;
        char name[0];
};
int main() {
    struct romfs_super_block *romfsb;
    int nblocks = ((__builtin_constant_p((__u32)((romfsb->size))) ?
        ({ __u32 __x = (((romfsb->size))); ((__u32)( (((__u32)(__x) &
(__u32)0x000000ffUL) << 24)
            | (((__u32)(__x) & (__u32)0x0000ff00UL) << 8) |
(((__u32)(__x) & (__u32)0x00ff0000UL) >> 8)
            | (((__u32)(__x) & (__u32)0xff000000UL) >> 24) )); })
        : __fswab32(((romfsb->size))))+(1<<10)-1)>>10;
}
======================

Attachment: test.c
Description: Text Data


reply via email to

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