* Full path in compiler warning/error messages
@ 2008-03-04 18:46 Geert Vancompernolle
2008-03-09 15:50 ` Geert Vancompernolle
0 siblings, 1 reply; 2+ messages in thread
From: Geert Vancompernolle @ 2008-03-04 18:46 UTC (permalink / raw)
To: gcc-help
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.
--
*Best rgds,
--Geert
*
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Full path in compiler warning/error messages
2008-03-04 18:46 Full path in compiler warning/error messages Geert Vancompernolle
@ 2008-03-09 15:50 ` Geert Vancompernolle
0 siblings, 0 replies; 2+ messages in thread
From: Geert Vancompernolle @ 2008-03-09 15:50 UTC (permalink / raw)
To: gcc-help
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
*
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-03-09 15:50 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-03-04 18:46 Full path in compiler warning/error messages Geert Vancompernolle
2008-03-09 15:50 ` Geert Vancompernolle
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).