Geert Vancompernolle wrote:
Hi,
I have a situation where I can only see part of the path name when
gcc/g++ finds errors/warnings. One such example is given below:
../src/mqmgr.cpp: In member function `virtual void
CMqMgrUnique::Execute()':
../src/mqmgr.cpp:319: warning: unsigned int format, pointer arg (arg 2)
../src/mqmgr.cpp:353: warning: int format, long int arg (arg 3)
../src/mqmgr.cpp:375: warning: int format, long int arg (arg 3)
This is the compiler invocation command currently used:
g++-cris -isystem
/home/foxboard/devboard-R2_01/target/cris-axis-linux-gnu/include
-mlinux -mno-mul-bug-workaround -c -Wall -Wshadow -O0 -g
-fno-omit-frame-pointer -DGVCDEBUG -fmessage-length=0
../src/mqmgr.cpp -o mqmgr.o
What is the option to tell the compiler (in the above case, compiling
for the CRIS) to show the whole path? Should be fairly easy to do,
but so far I didn't find the option.
Found it out myself:
I was not passing the complete path when invoking the compilation. In
my Makefile, I had the following construction:
...
%.o: $(SRCDIR)/%.cpp
@echo
@echo " ==> Compiling C++-target ***\"$<\"***..."
$(CXX) -c $(CFLAGS) $< -o $*.o
$(CXX) -MM $(CFLAGS) $< > $*.d
@mv -f $*.d $*.d.tmp
@sed -e 's|.*:|$*.o:|' < $*.d.tmp > $*.d
@sed -e 's/.*://' -e 's/\\$$//' < $*.d.tmp | fmt -1 | sed -e 's/^
*//' -e 's/$$/:/' >> $*.d
@rm -f $*.d.tmp
...
where SRCDIR was defined as follows:
SRCDIR := ../src
Now, I've defined SRCDIR as follows:
SRCDIR := $(shell pwd)/../src
This time, the compiler gives me the full path.
So, it has apparently nothing to do with compiler options, it's just a
matter how you invoke the compiler...
--
*Best rgds,
--Geert
*