On 05/21/12 16:34, Sebastian Dransfeld wrote: > On 05/21/2012 08:24 AM, Bluezery wrote: >> Hello, >> >> Some efreet APIs do not check input parameters. So I add checking by >> using EINA_SAFETY_ON_XXX(). >> ISO/IEC statndards says that "If an argument to a function has an >> invalid value, behavior is undefined" . But this is just for the >> primitive functions such as libc. I think that parameter checking is >> needed in at least EFL exported APIs
This I 150% support (Not the use of Eina, but rather the checking) !! Exported APIs need to be clean.... EFL needs lots of param checking. Has been missing for a bit of time now. I try to add it as I go, but not everyone is supportive. Some do see it as a "wasted variable check" ... but I would rather KNOW that the stuff I am working with IS valid first, before I start to work with it ;) ... If not, then what's left ? A Guess that the variable is valid ??? No thanks ;) to prevent run-time abnormal >> behavior. Bail out nicely if you can ... ;) >> EINA_SAFTETY_ON_XXX are better than "if (xxx) return" because it gives >> error message and can be maintainable. But adds some overhead for the logging..... 'if (xxx) return' is easier to read then chasing down (in a bunch of source code) some obscure macros that nobody knows....and printf is cheap (afaik), easily removed... >> Actually these may be needed for some static internal functions. But >> I did not add. >> >> If this patches would be acceptable, I will add these checking into >> other efreet files (efreet_menu, efreet_base, etc.) > > Patch is fine. Just add to other efreet files and I will commit. > > S. Seb, as long as you approve it then no worries ;) Never got into efreet...least not much past the initial fdo support .... but I trust Seb. He's been here for a long long LONG time... Cheers, dh > > ------------------------------------------------------------------------------ > Live Security Virtual Conference > Exclusive live event will cover all the ways today's security and > threat landscape has changed and how IT managers can respond. Discussions > will include endpoint security, mobile security and the latest in malware > threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ > _______________________________________________ > enlightenment-devel mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/enlightenment-devel > ------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ _______________________________________________ enlightenment-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
