Fossil SCM

Make sure that "fossil_strcmp" is used everywhere in stead of "strcmp": The "strcmp" function from the C library is not usable in all situations, e.g. with --static on Linux Do an #undef in printf.c, preventing that the fossil_strcmp function is optimized for non-null arguments.

jan.nijtmans 2013-01-30 13:10 UTC trunk merge
Commit afffe486433251f3e9675e566c62849f38e09f7c
+1 -1
--- Makefile.in
+++ Makefile.in
@@ -37,11 +37,11 @@
3737
# care about testing the end result, this can be blank.
3838
#
3939
TCLSH = tclsh
4040
4141
LIB = @LDFLAGS@ @EXTRA_LDFLAGS@ @LIBS@
42
-TCC += @EXTRA_CFLAGS@ @CPPFLAGS@ @CFLAGS@ -DHAVE_AUTOCONFIG_H
42
+TCC += @EXTRA_CFLAGS@ @CPPFLAGS@ @CFLAGS@ -DHAVE_AUTOCONFIG_H -Dstrcmp=fossil_strcmp
4343
INSTALLDIR = $(DESTDIR)@prefix@/bin
4444
USE_SYSTEM_SQLITE = @USE_SYSTEM_SQLITE@
4545
FOSSIL_ENABLE_TCL = @FOSSIL_ENABLE_TCL@
4646
FOSSIL_ENABLE_TCL_STUBS = @FOSSIL_ENABLE_TCL_STUBS@
4747
4848
--- Makefile.in
+++ Makefile.in
@@ -37,11 +37,11 @@
37 # care about testing the end result, this can be blank.
38 #
39 TCLSH = tclsh
40
41 LIB = @LDFLAGS@ @EXTRA_LDFLAGS@ @LIBS@
42 TCC += @EXTRA_CFLAGS@ @CPPFLAGS@ @CFLAGS@ -DHAVE_AUTOCONFIG_H
43 INSTALLDIR = $(DESTDIR)@prefix@/bin
44 USE_SYSTEM_SQLITE = @USE_SYSTEM_SQLITE@
45 FOSSIL_ENABLE_TCL = @FOSSIL_ENABLE_TCL@
46 FOSSIL_ENABLE_TCL_STUBS = @FOSSIL_ENABLE_TCL_STUBS@
47
48
--- Makefile.in
+++ Makefile.in
@@ -37,11 +37,11 @@
37 # care about testing the end result, this can be blank.
38 #
39 TCLSH = tclsh
40
41 LIB = @LDFLAGS@ @EXTRA_LDFLAGS@ @LIBS@
42 TCC += @EXTRA_CFLAGS@ @CPPFLAGS@ @CFLAGS@ -DHAVE_AUTOCONFIG_H -Dstrcmp=fossil_strcmp
43 INSTALLDIR = $(DESTDIR)@prefix@/bin
44 USE_SYSTEM_SQLITE = @USE_SYSTEM_SQLITE@
45 FOSSIL_ENABLE_TCL = @FOSSIL_ENABLE_TCL@
46 FOSSIL_ENABLE_TCL_STUBS = @FOSSIL_ENABLE_TCL_STUBS@
47
48
--- src/printf.c
+++ src/printf.c
@@ -15,10 +15,15 @@
1515
**
1616
*******************************************************************************
1717
**
1818
** An implementation of printf() with extra conversion fields.
1919
*/
20
+
21
+/* prevent "fossil_strcmp" to be optimized using the assumption
22
+ * that its arguments cannot be NULL */
23
+#undef fossil_strcmp
24
+
2025
#include "config.h"
2126
#include "printf.h"
2227
2328
/*
2429
** Conversion types fall into various categories as defined by the
2530
--- src/printf.c
+++ src/printf.c
@@ -15,10 +15,15 @@
15 **
16 *******************************************************************************
17 **
18 ** An implementation of printf() with extra conversion fields.
19 */
 
 
 
 
 
20 #include "config.h"
21 #include "printf.h"
22
23 /*
24 ** Conversion types fall into various categories as defined by the
25
--- src/printf.c
+++ src/printf.c
@@ -15,10 +15,15 @@
15 **
16 *******************************************************************************
17 **
18 ** An implementation of printf() with extra conversion fields.
19 */
20
21 /* prevent "fossil_strcmp" to be optimized using the assumption
22 * that its arguments cannot be NULL */
23 #undef fossil_strcmp
24
25 #include "config.h"
26 #include "printf.h"
27
28 /*
29 ** Conversion types fall into various categories as defined by the
30
--- src/printf.c
+++ src/printf.c
@@ -15,10 +15,15 @@
1515
**
1616
*******************************************************************************
1717
**
1818
** An implementation of printf() with extra conversion fields.
1919
*/
20
+
21
+/* prevent "fossil_strcmp" to be optimized using the assumption
22
+ * that its arguments cannot be NULL */
23
+#undef fossil_strcmp
24
+
2025
#include "config.h"
2126
#include "printf.h"
2227
2328
/*
2429
** Conversion types fall into various categories as defined by the
2530
--- src/printf.c
+++ src/printf.c
@@ -15,10 +15,15 @@
15 **
16 *******************************************************************************
17 **
18 ** An implementation of printf() with extra conversion fields.
19 */
 
 
 
 
 
20 #include "config.h"
21 #include "printf.h"
22
23 /*
24 ** Conversion types fall into various categories as defined by the
25
--- src/printf.c
+++ src/printf.c
@@ -15,10 +15,15 @@
15 **
16 *******************************************************************************
17 **
18 ** An implementation of printf() with extra conversion fields.
19 */
20
21 /* prevent "fossil_strcmp" to be optimized using the assumption
22 * that its arguments cannot be NULL */
23 #undef fossil_strcmp
24
25 #include "config.h"
26 #include "printf.h"
27
28 /*
29 ** Conversion types fall into various categories as defined by the
30

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button