Package: tcc
Version: 0.9.22-2
Severity: normal

The following program makes tcc dump core:

#define _FILE_OFFSET_BITS 64
#include <sys/types.h>
#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
  int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
                       && LARGE_OFF_T % 2147483647 == 1)
                      ? 1 : -1];
int main (void)
{
  return 0;
}

Autoconf-generated scripts use a variant of this check to determine the
flags needed for large file support.  The idea is for the compiler to accept
the program iff off_t can represent 2**63.  Although tcc apparently supports
long long, this program makes it dump core, leading configure to believe
that defining _FILE_OFFSET_BITS is useless!

Removing the first line "works" correctly -- in the sense that tcc will
complain about the "invalid array size", as intended for 32-bit off_t.

The offending program can be reduced even further:

int array[(1LL << 0) ? 1 : -1];
int main (void) { return 0; }

If either 1LL is changed to 1, or "<< 0" is removed, the program compiles.
An even simpler program that causes the core dump is:

int array[1LL << 0];
int main (void) { return 0; }

Again, either changing 1LL to 1 or omitting the shift causes core dump to go
away.

-- System Information:
Debian Release: 3.1
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: i386 (i686)
Kernel: Linux 2.6.8-1-686
Locale: LANG=en_US, LC_CTYPE=en_US (charmap=ISO-8859-1)

Versions of packages tcc depends on:
ii  libc6                       2.3.2.ds1-20 GNU C Library: Shared libraries an

-- no debconf information


-- System Information:
Debian Release: 3.1
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: i386 (i686)
Kernel: Linux 2.6.8-1-686
Locale: LANG=en_US, LC_CTYPE=en_US (charmap=ISO-8859-1)

Versions of packages tcc depends on:
ii  libc6                       2.3.2.ds1-20 GNU C Library: Shared libraries an

-- no debconf information


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to