Article View: comp.std.c
Article #1476SIZE_T_MAX (Re: More fwrite limits)
From: Felix Lee
Date: Fri, 06 Jul 1990 06:03
Date: Fri, 06 Jul 1990 06:03
11 lines
959 bytes
959 bytes
Without something like SIZE_T_MAX, it can be hard to write portable programs that behave sensibly on various overflow conditions. Here are some innocuous statements that can run into trouble, especially when size_t is 16 bits: s = malloc(strlen(a) + strlen(b) + 1); c = n * sizeof(x); I'd also like to have PTRDIFF_T_MIN and PTRDIFF_T_MAX and WCHAR_T_MAX and.... To bad there isn't something similar to Ada's INTEGER'LAST. -- Felix Lee flee@cs.psu.edu
Technical Details
Message-ID:
<Fq7k90?@cs.psu.edu>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!mailrus!cs.utexas.edu!samsung!zaphod.mps.ohio-state.edu!wuarchive!psuvax1!newsReferences:
<3159@disk.UUCP> <25096@mimsy.umd.edu> <Fw?ycgy@cs.psu.edu> <13284@smoke.BRL.MIL>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!mailrus!cs.utexas.edu!samsung!zaphod.mps.ohio-state.edu!wuarchive!psuvax1!news From: flee@guardian.cs.psu.edu (Felix Lee) Newsgroups: comp.std.c Subject: SIZE_T_MAX (Re: More fwrite limits) Message-ID: <Fq7k90?@cs.psu.edu> Date: 6 Jul 90 06:03:17 GMT References: <3159@disk.UUCP> <25096@mimsy.umd.edu> <Fw?ycgy@cs.psu.edu> <13284@smoke.BRL.MIL> Sender: news@cs.psu.edu (Usenet) Organization: Penn State Computer Science Lines: 11