From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jeroen Hofstee Date: Mon, 01 Jul 2013 22:12:27 +0200 Subject: [U-Boot] [PATCH 2/3] tools/proftool: add missing definition In-Reply-To: <51D1CE3F.5000000@myspectrum.nl> References: <1372590906-75089-1-git-send-email-andreas.devel@googlemail.com> <1372590906-75089-3-git-send-email-andreas.devel@googlemail.com> <51D1CE3F.5000000@myspectrum.nl> Message-ID: <51D1E2AB.8070005@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 07/01/2013 08:45 PM, Jeroen Hofstee wrote: > 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. > Just realized this is more then cosmetic. Also GNU will not have REG_NOERROR defined since it is an enum, so it will always take the #ifndef REG_NOERROR road, which boils down to !! 0. So this needs a new version instead of hiding how this works. Regards, Jeroe p.s. Simon, Andreas sorry for spamming, selected the wrong email...