Issue Details (XML | Word | Printable)

Key: PCC-119
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Anders Magnusson
Reporter: Jörg Schilling
Votes: 0
Watchers: 0

If you were logged in you would be able to see more operations.

cpp fails with large file autoconf test

Created: 23/Feb/10 06:10 PM   Updated: 16/Jun/10 09:43 PM
Component/s: C preprocessor
Affects Version/s: None
Fix Version/s: None

Environment: Solaris SXCE SNV_105

 Description  « Hide
The code created by the autoconf test for large files seems to be evaluated
as long long (ingnoring the casts) and thus fails to fail without #define _FILE_OFFSET_BITS 64

The code is:

#include <sys/types.h>
    /* Check that off_t can represent 2**63 - 1 correctly.
       We can't simply "#define LARGE_OFF_T 9223372036854775807",
       since some C++ compilers masquerading as C compilers
       incorrectly reject 9223372036854775807. */
# 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() {
; return 0; }

and it is expeted to declare an array of size -1 in case that there
is no large file support.

 All   Comments   Change History      Sort Order: Ascending order - Click to sort in descending order
Anders Magnusson added a comment - 25/Feb/10 06:54 PM
What is off_t declared as?

Jörg Schilling added a comment - 26/Feb/10 12:41 AM
If _FILE_OFFSET_BITS is not defined and the compiled program
is a 32 bit program, then off_t is "long".

Anders Magnusson added a comment - 16/Jun/10 09:43 PM
Fixed now. Internal constant calculatons are from now on trimmed to the resulting type size.