public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
From: alex@softgrow.com
To: gcc-gnats@gcc.gnu.org
Cc: wilf@techco.ab.ca, pedwards@disaster.jaj.com
Subject: libstdc++/4886: Solaris largefile support for fopen removed by include/g++-v3/bits/std_cstdio.h
Date: Mon, 05 Nov 2001 00:13:00 -0000	[thread overview]
Message-ID: <20011116005105.16654.qmail@sourceware.cygnus.com> (raw)


>Number:         4886
>Category:       libstdc++
>Synopsis:       Solaris largefile support for fopen removed by include/g++-v3/bits/std_cstdio.h
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Nov 15 16:56:00 PST 2001
>Closed-Date:
>Last-Modified:
>Originator:     Wilf Kruggel
>Release:        unknown-1.0
>Organization:
>Environment:
Solaris 8.0 
gcc 3.0.2
>Description:
When compiling on Solaris for files > 2 Gigs the flag -D_FILE_OFFSET_BITS=64 and -D_LARGEFILE_SOURCE cause the Solaris supplied /usr/include/stdio.h to create define fopen as fopen64 using a macro.
This macro is undefined by the gcc include/g++-v3/bits/.std_cstdio.h
Thus any attempt to open a largefile in compiled code will fail on execution with an error "Value too large for defined data type". Truss will show fopen being called rather than fopen64.
>How-To-Repeat:
Try the following code on a large file > 2 Gigs
g++ `LFS_CLFAGS` -o junk junk.c 
#include <cstdio>

main()
{
  FILE *fp = fopen("reallybigfile.gen","rb");
  if (fp==NULL) perror("fopen");
}
You will get when you run 
fopen: Value too large for defined data type
>Fix:
remove "#undef fopen" (and same for fgetpos, freopen, fsetpos) in std_cstdio.h but this may break something else. 
>Release-Note:
>Audit-Trail:
>Unformatted:


             reply	other threads:[~2001-11-16  0:56 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-11-05  0:13 alex [this message]
2002-11-06  9:32 bangerth

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20011116005105.16654.qmail@sourceware.cygnus.com \
    --to=alex@softgrow.com \
    --cc=gcc-gnats@gcc.gnu.org \
    --cc=pedwards@disaster.jaj.com \
    --cc=wilf@techco.ab.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).