Article View: comp.lang.c
Article #1973Re: is wraper on realloc good idea? maybe more wrappers?
From: fir
Date: Sun, 29 Nov 2026 17:26
Date: Sun, 29 Nov 2026 17:26
29 lines
2806 bytes
2806 bytes
Ross Finlayson pisze: > On 11/29/2026 08:48 AM, fir wrote: >> Andrey Tarasevich pisze: >>> On Sun 11/29/2026 4:16 AM, fir wrote: >>>> never used it but generally wrappers on some standard functions >>>> probably are good idea, or not? >>> >>> In programs that perform non-interactive batch-style processing (e.g. >>> config file on input, result file on output), error handling is >>> usually a very simple affair: just complain and abort, no need for any >>> kind of post-error recovery in most cases. In such programs wrappers >>> around malloc/calloc/realloc work very well. The wrapper checks for >>> success and simply aborts the entire program with an error message in >>> case of failure. This allows client code to completely forget about >>> having to worry about this sort of errors. I.e. it uses the wrapper >>> under assumption that the wrapper "always succeeds". >>> >> >> but there is normal ERROR (the one that calls ERROR() function , more >> specifically ERROR_() in my case as ERROR is by some sht reserved by >> winapi i guess) and there are CRASHes..crashes you need to localize, >> in winapi i may register signel handler so it calls my function that for >> example shows messagoe box .. > > Does it build just fine on Navia's LCC or Mingw64? > i use mingw32 and some older version as when i last checked (quite few years ago) the more new was slower..(and i prefer faster)
Technical Details
Message-ID:
<11ehn8f$3ml53$1@dont-email.me>Path:
mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.hispagatos.org!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mailReferences:
<11eh538$3fet7$1@dont-email.me> <11ehine$3kr02$1@dont-email.me> <11ehl0l$3lnis$1@dont-email.me> <TPadnZE62NL0x5H2nZ2dnZfqn_aOsyBo@giganews.com>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.hispagatos.org!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mail From: fir <profesor.fir@gmail.com> Newsgroups: comp.lang.c Subject: Re: is wraper on realloc good idea? maybe more wrappers? Date: Sun, 29 Nov 2026 18:26:40 +0100 Organization: A noiseless patient Spider Lines: 29 Message-ID: <11ehn8f$3ml53$1@dont-email.me> References: <11eh538$3fet7$1@dont-email.me> <11ehine$3kr02$1@dont-email.me> <11ehl0l$3lnis$1@dont-email.me> <TPadnZE62NL0x5H2nZ2dnZfqn_aOsyBo@giganews.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Sun, 29 Nov 2026 17:26:40 +0000 (UTC) Injection-Info: dont-email.me; logging-data="3888291"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18unWR3OBUUQ//6M0PyRvSu2WKgwJ5N1IE="; posting-host="010f8b8bacc4ceb5b8d9de2edad353cd" User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:140.0) Gecko/20100101 Firefox/140.0 SeaMonkey/2.53.24 Cancel-Lock: sha1:8rX+Hql8s7ziEUvpYPyP6AmNrYs= sha256:SUzY2fhJ/zpxtgnwTGQPZJdjURSwEDqrXi6nyrpQ/Ow= sha1:SXZQYJ/rlwrSyIeAeCeJF/UUY+w= sha256:AFQZ1vOXW22RC0UmN/KLQG4gN2EhseYvld0xcXlBnog= In-Reply-To: <TPadnZE62NL0x5H2nZ2dnZfqn_aOsyBo@giganews.com>