Oh... personal attacks. I knew this thread was missing something. Short answer: If checking the return of alloca is so important to you then either commit a fix or send a patch.
I still am of the opionion that checking the return of alloca means you don't know what it does. In the specific case you mentioned the code also called free on the return of alloca. So my little rule did indeed catch a real bug. nash On Sun, 4 Jul 2010 14:12:54 -0700 Michael Jennings <m...@kainx.org> wrote: > On Sunday, 04 July 2010, at 02:45:37 (-0400), > Jose Gonzalez wrote: > > > In any case, you may want to bring this discussion up with the > > author of: > > > > evas/src/lib/engines/common/evas_map_image_internal.c > > > > where around line 78 you'll find some code that reads: > > > > // // allocate some spans to hold out span list > > spans = alloca((yend - ystart + 1) * sizeof(Line)); > > if (!spans) return; > > Good advice. If you're going to be a douche, know whom you're being a > douche to. :-) > > As for platforms where alloca() can return NULL: > http://docs.embarcadero.com/products/rad_studio/delphiAndcpp2009/HelpUpdate2/EN/html/devwin32/alloca_xml.html > http://www.mkssoftware.com/docs/man3/alloca.3.asp > http://www.ousob.com/ng/turboc/ng5738.php > > I also found a number of alloca() implementations which return NULL if > asked to alloca(0), which could result if the parameter is an > arithmetic expression (or if someone's trying to take your advice > about how to get the stack pointer). > > But whatever. It's not like E/EFL code would ever run on any new or > obscure platforms, appliances, or anything like that. And checking > for NULL simply takes far too many cycles. > > Michael > ------------------------------------------------------------------------------ This SF.net email is sponsored by Sprint What will you do first with EVO, the first 4G phone? Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first _______________________________________________ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel