Bug in Boog/mbkvhdlg. Compilation issues in ocp & ppt.

* Bug: In <mbkvhdlg>, cast the hash table index entries from pointer
    to unsigned long instead of long to avoid negative numbers when
    computing the modulo (shows on Cygwin). This was causing <boog>
    to crash.
* Bug: In <ppt>, with bison 2.7, yylval must not be re-declared extern
    (didn't show on earlier versions).
* Change: In <ocp>, uses "-std=gnu++0x" instead of "-std=c++0x" to
    have both C++11 features *and* POSIX features (namely: strdup).
    The problem is that strdup is *not* ANSI, but only POSIX and as
    such, not defined when c++0x is active. Will have to change
    again in the future as gnu++0x is on the way of deprecation...
This commit is contained in:
Jean-Paul Chaput 2014-04-07 13:50:48 +02:00
parent 4a9f673667
commit 0f2a3365ec
5 changed files with 10 additions and 7 deletions

4
.gitignore vendored
View File

@ -12,6 +12,7 @@ ltmain.sh
missing
depcomp
alliance/src/configure.in
alliance/src/ltmain.sh
dev/scripts/cppcheck/*
*.eps
*.aux
@ -20,4 +21,5 @@ dev/scripts/cppcheck/*
*.log
*.lst
archives/
cvsCommit.txt
gitCommit.txt

View File

@ -41,7 +41,7 @@ char *ctx_str;
struct dct_recrd *recrd_pnt;
struct dct_recrd *last_recrd = NULL;
index = (long)key_str % MVL_HSZDFN;
index = (unsigned long)key_str % MVL_HSZDFN;
entry_pnt = head [index];
while (entry_pnt != NULL)
@ -204,7 +204,7 @@ long valu;
struct dct_entry *entry_pnt;
struct dct_recrd *recrd_pnt;
index = (long) key_str % MVL_HSZDFN;
index = (unsigned long) key_str % MVL_HSZDFN;
entry_pnt = head[index];
while (entry_pnt != NULL)
@ -287,7 +287,7 @@ long field;
struct dct_entry *entry_pnt;
struct dct_recrd *recrd_pnt;
entry_pnt = head [(long)key_str % MVL_HSZDFN];
entry_pnt = head [(unsigned long)key_str % MVL_HSZDFN];
while (entry_pnt != NULL)
{

View File

@ -1,6 +1,6 @@
## Process this file with automake to produce Makefile.in
AM_CXXFLAGS = @ALLIANCE_CFLAGS@ -I$(top_srcdir)/mbk/src -std=c++0x
AM_CXXFLAGS = @ALLIANCE_CFLAGS@ -I$(top_srcdir)/mbk/src -std=gnu++0x
noinst_LIBRARIES = libPCommon.a

View File

@ -4,7 +4,7 @@ YACC = @YACC@ -d
INCLUDES = -I$(srcdir)/../common
AM_CXXFLAGS = @ALLIANCE_CFLAGS@ -I$(top_srcdir)/mbk/src -std=c++0x
AM_CXXFLAGS = @ALLIANCE_CFLAGS@ -I$(top_srcdir)/mbk/src -std=gnu++0x
AM_CFLAGS = @ALLIANCE_CFLAGS@ -I$(top_srcdir)/mbk/src
bin_PROGRAMS = ocp

View File

@ -19,11 +19,12 @@ pat_decl_y.c pat_decl_y.h : $(srcdir)/pat_decl_y.y
$(YACC) -d $(YFLAGS) $(srcdir)/pat_decl_y.y \
&& sed -e "s/yy/pat_decl_y_/g" -e "s/YY/PAT_DECL_Y_/g" y.tab.c \
| sed -e "s/int[ ]*pat_decl_y_char;/extern int pat_decl_y_char;/" \
| sed -e "s/PAT_DECL_Y_STYPE[ ]*pat_decl_y_lval;/extern PAT_DECL_Y_STYPE pat_decl_y_lval;/" \
| sed -e "s/int[ ]*pat_decl_y_nerrs;/extern int pat_decl_y_nerrs;/" \
> pat_decl_y.c \
&& sed -e "s/yy/pat_decl_y_/g" -e "s/YY/PAT_DECL_Y_/g" y.tab.h > pat_decl_y.h
# | sed -e "s/PAT_DECL_Y_STYPE[ ]*pat_decl_y_lval;/extern PAT_DECL_Y_STYPE pat_decl_y_lval;/"
pat_decl_l.c : $(srcdir)/pat_decl_l.l pat_decl_y.h
$(LEX) -t $(srcdir)/pat_decl_l.l | sed -e "s/yy/pat_decl_y_/g" -e "s/YY/PAT_DECL_Y_/g" > pat_decl_l.c