From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jeroen Hofstee Date: Mon, 01 Jul 2013 20:45:19 +0200 Subject: [U-Boot] [PATCH 2/3] tools/proftool: add missing definition In-Reply-To: <1372590906-75089-3-git-send-email-andreas.devel@googlemail.com> References: <1372590906-75089-1-git-send-email-andreas.devel@googlemail.com> <1372590906-75089-3-git-send-email-andreas.devel@googlemail.com> Message-ID: <51D1CE3F.5000000@myspectrum.nl> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hello Andreas, On 06/30/2013 01:15 PM, Andreas Bie?mann wrote: > BSD (like OS X) variants of regex.h do not declare REG_NOERROR, add a simple > define for them. > > Signed-off-by: Andreas Bie?mann > --- > > +#ifndef REG_NOERROR > +/* BSD regex.h do not expose REG_NOERROR */ > +# define REG_NOERROR 0 > +#endif > + I think a neater solutions is to actually remove the REG_NOERROR. From man regexec, GNU 2011-09-27: "regexec() returns zero for a successful match or REG_NOMATCH for failure.". Opengroup specs will mention the same. REG_NOERROR is not mentioned at all. e.g.: if (err) { regex_report_error(&item->regex, err, "match", item->name); break; } should do the job in a portable way (and reads a bit better, as well). But this is only a cosmetic comment, the patch by itself should do the job. Regards, Jeroen p.s. Strictly speaking it is dead code actually...