bug-cflow
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug-cflow] how to handle redefines, in particular the ellipsis symbol


From: Larry Evans
Subject: [bug-cflow] how to handle redefines, in particular the ellipsis symbol
Date: Sun, 08 Nov 2009 10:47:17 -0600
User-agent: Thunderbird 2.0.0.23 (X11/20090817)

While running cflow on gcc's preprocessed gcc/cp/pt.c, I get:

cflow:/usr/include/stdio.h:404: .../-1 redefined
cflow:/usr/include/stdio.h:362: this is the place of previous definition
cflow:/usr/include/fcntl.h:120: .../-1 redefined
cflow:/usr/include/stdio.h:404: this is the place of previous definition
cflow:/usr/include/malloc.h:50: malloc/1 redefined
cflow:/usr/include/stdlib.h:471: this is the place of previous definition
cflow:/home/evansl/download/gcc/svn/patch.none.gdb/build/../src/gcc/../include/libiberty.h:149: .../-1 redefined
cflow:/usr/include/fcntl.h:120: this is the place of previous definition
cflow:/usr/include/gmp.h:1643: __gmpz_fits_ulong_p/1 redefined
cflow:/usr/include/gmp.h:845: this is the place of previous definition
I attempted to workaround the problem by using a cflow option:

 --symbol <SomeRedefinedSymbol>:wrapper

where <SomeRedefinedSymbol> is one of the symbols preceding the '/-redefined'
in the aforementioned error messages.  This seems to work for some
symbols; however, for ..., it doesn't.  I tried:

 --symbol ...:type

and:

 --symbol \.\.\.:type

however, neither worked.

How can I get cflow to not diagnose ... as a redefined symbol?
My Makefile, cflow.mk, and a perl program, cflow.redefined.pl,
used to generate the --symbol options, are attached.

TIA.

-regards,
Larry


SRC.name=pt
TAR.path=cp
SRC.dir=/home/evansl/download/gcc/svn/patch.none.gdb/build/../src/gcc

CFLOW.redefined.syms:= $(shell cat cflow.redefined.out)

CFLOW.wrappers= \
  --symbol GTY:wrapper \
  --symbol __MALLOC_P:wrapper \
  --symbol __attribute_malloc__:wrapper \
  --symbol \.\.\.:type \
  $(CFLOW.redefined.syms)

.PHONY: cflow.redefined.inp

###The following was based on copying part of the output from:
#
#  make -W ./gcc/cp/pt.c -n
#
#The part copied was the output showing the command line for
#compiling cp/pt.c
#

#C.flags= -DIN_GCC -DHAVE_CONFIG_H -I. -Icp 
-I/home/evansl/download/gcc/svn/patch.none.gdb/build/../src/gcc 
-I/home/evansl/download/gcc/svn/patch.none.gdb/build/../src/gcc/cp 
-I/home/evansl/download/gcc/svn/patch.none.gdb/build/../src/gcc/../include 
-I/home/evansl/download/gcc/svn/patch.none.gdb/build/../src/gcc/../libcpp/include
  
-I/home/evansl/download/gcc/svn/patch.none.gdb/build/../src/gcc/../libdecnumber 
-I/home/evansl/download/gcc/svn/patch.none.gdb/build/../src/gcc/../libdecnumber/bid
 -I../libdecnumber

C.flags=-g -fkeep-inline-functions -DIN_GCC   -W -Wall -Wwrite-strings 
-Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wmissing-format-attribute 
-pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -Werror 
-Wold-style-definition -Wc++-compat -fno-common  -DHAVE_CONFIG_H -I. -Icp 
-I/home/evansl/download/gcc/svn/patch.none.gdb/build/../src/gcc 
-I/home/evansl/download/gcc/svn/patch.none.gdb/build/../src/gcc/cp 
-I/home/evansl/download/gcc/svn/patch.none.gdb/build/../src/gcc/../include 
-I/home/evansl/download/gcc/svn/patch.none.gdb/build/../src/gcc/../libcpp/include
  
-I/home/evansl/download/gcc/svn/patch.none.gdb/build/../src/gcc/../libdecnumber 
-I/home/evansl/download/gcc/svn/patch.none.gdb/build/../src/gcc/../libdecnumber/bid
 -I../libdecnumber

###Create preprocessor output files.
%.E.c: %.c
        gcc -E $(C.flags) $< -o $@

###The following is based on:
#
#  http://www.gnu.org/software/cflow/manual/cflow.html#Makefiles
#
GCC.srcs=$(SRC.dir)/$(TAR.path)/$(SRC.name).E.c

cflow.gcc: $(GCC.srcs) cflow.mk cflow.redefined.out
        cflow $(CFLOW.wrappers) -o $@ $(GCC.srcs)

cflow.redefined.inp:
        cflow $(CFLOW.wrappers)-o /dev/null $(GCC.srcs) 2> address@hidden
        cat address@hidden>>$@

cflow.redefined.out: cflow.redefined.inp cflow.redefined.pl
        ./cflow.redefined.pl < $< > $@

echo:
        @echo CFLOW.redefined.syms=$(CFLOW.redefined.syms)

Attachment: cflow.redefined.pl
Description: Perl program


reply via email to

[Prev in Thread] Current Thread [Next in Thread]