Article View: comp.lang.c
Article #1972Re: is wraper on realloc good idea? maybe more wrappers?
From: Ross Finlayson
Date: Sun, 29 Nov 2026 17:00
Date: Sun, 29 Nov 2026 17:00
26 lines
2691 bytes
2691 bytes
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?
Technical Details
Message-ID:
<TPadnZE62NL0x5H2nZ2dnZfqn_aOsyBo@giganews.com>Path:
mbox-mo1.pugleaf.net!srv.newsdeef.eu!weretis.net!feeder9.news.weretis.net!border-3.nntp.ord.giganews.com!nntp.giganews.com!local-3.nntp.ord.giganews.com!Xl.tags.giganews.com!local-2.nntp.ord.giganews.com!news.giganews.com.POSTED!not-for-mailReferences:
<11eh538$3fet7$1@dont-email.me> <11ehine$3kr02$1@dont-email.me> <11ehl0l$3lnis$1@dont-email.me>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!weretis.net!feeder9.news.weretis.net!border-3.nntp.ord.giganews.com!nntp.giganews.com!local-3.nntp.ord.giganews.com!Xl.tags.giganews.com!local-2.nntp.ord.giganews.com!news.giganews.com.POSTED!not-for-mail NNTP-Posting-Date: Sun, 29 Nov 2026 17:01:29 +0000 Subject: Re: is wraper on realloc good idea? maybe more wrappers? Newsgroups: comp.lang.c References: <11eh538$3fet7$1@dont-email.me> <11ehine$3kr02$1@dont-email.me> <11ehl0l$3lnis$1@dont-email.me> From: Ross Finlayson <ross.a.finlayson@gmail.com> Date: Sun, 29 Nov 2026 09:00:57 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 MIME-Version: 1.0 In-Reply-To: <11ehl0l$3lnis$1@dont-email.me> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Message-ID: <TPadnZE62NL0x5H2nZ2dnZfqn_aOsyBo@giganews.com> Lines: 26 X-Usenet-Provider: http://www.giganews.com X-Trace: sv3-H54NG6vB2jXzNiX2cngi5Sr9362ojsbX8w8RI+W9fAGpxg6g+1tar8ZvuOn6avXXplckmmuE1azhBHd!SxxRL2wzNE5aisnP1tSnM8t9L3YCKVN8Ugeo5N0h0BiCWqsNyJWKJHqlHUjrF3uMm74t61AjzzrP X-Complaints-To: abuse@giganews.com X-DMCA-Notifications: http://www.giganews.com/info/dmca.html X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.40