While I agree that the -Dstrcmp... solution is inadequate, strcmp is subject to the system locale setting. While it might default to the C locale (giving the expected binary comparison behavior), it might not. One may not consider locale the same as localization, but whatever you choose to call it, it can result in non-deterministic behavior based on the exact system configuration.
SDR On Wed, Jan 30, 2013 at 8:19 AM, Richard Hipp <d...@sqlite.org> wrote: > > > On Wed, Jan 30, 2013 at 8:11 AM, Jan Nijtmans <jan.nijtm...@gmail.com> > wrote: >> >> 2013/1/30 Sergei Gavrikov <sergei.gavri...@gmail.com>: >> > [FYI] >> > >> > An optimized (-O2) default build with entered substitution >> > -Dstrcmp=fossil_strcmp fails (SIGSEG) on i686 GNU/Linux >> ... >> > Program received signal SIGSEGV, Segmentation fault. >> ... >> >> Thanks! That's fully explainable: When setting -Dstrcmp=fossil_strcmp >> before including <string.h>, and strcmp has a decoration that its >> arguments are non-null, that is used by the optimizer to remove >> the two first if's from the fossil_strcmp function: if its arguments >> cannot be NULL, that's a valid optimization.... >> >> Should be fixed now, by #undef'fing fossil_strcmp in printf.c > > > I'm uncomfortable with this change. If we need to use fossil_strcmp() > everywhere (which surprises me, since strcmp() should *not* be subject to > localization) then we should do so explicitly, and not depend on > preprocessor magic, as the preprocessor magic will likely cause maintenance > headaches down the road, and/or introduce subtle bugs such as the above. > > >> >> >> Many Thanks!!!!! >> >> Regards, >> Jan Nijtmans >> _______________________________________________ >> fossil-users mailing list >> fossil-users@lists.fossil-scm.org >> http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users > > > > > -- > D. Richard Hipp > d...@sqlite.org > _______________________________________________ > fossil-users mailing list > fossil-users@lists.fossil-scm.org > http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users > _______________________________________________ fossil-users mailing list fossil-users@lists.fossil-scm.org http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users