|
From: Brendan B. <bb...@cs...> - 2005-05-10 13:54:05
|
Hello,
I just tried to compile the latest CVS on Mac OS X (10.4, gcc 4.0)
and it failed with the error:
gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../term -I../term -DBINDIR=\"/usr/
local/bin\" -DX11_DRIVER_DIR=\"/usr/local/libexec/gnuplot/4.1\" -
DCONTACT=\"gnu...@li...\" -DHELPFILE=\"/usr/
local/share/gnuplot/4.1/gnuplot.gih\" -g -O2 -ObjC -c `test -f
'term.c' || echo './'`term.c
In file included from term.h:400,
from term.c:1205:
../term/pslatex.trm:120: error: static declaration of
'epslatex_header' follows non-static declaration
../term/post.h:88: error: previous declaration of 'epslatex_header'
was here
Changing
"static char *epslatex_header..." -> "char *epslatex_header..." in
pslatex.trm fixed the compile error. I didn't try the pslatex
terminal to see if it worked, but I think it should.
--brendan
|
|
From: Hans-Bernhard B. <br...@ph...> - 2005-05-11 19:18:43
|
Brendan Burns wrote: > In file included from term.h:400, > from term.c:1205: > ../term/pslatex.trm:120: error: static declaration of 'epslatex_header' > follows non-static declaration > ../term/post.h:88: error: previous declaration of 'epslatex_header' was > here That's strange --- this is usually just a warning, not an error. Did GCC change its behaviour on this? > Changing > "static char *epslatex_header..." -> "char *epslatex_header..." in > pslatex.trm fixed the compile error. It's quite probably the wrong direction of change, though. Making the declaration in post.h 'static' makes more sense. Actually, it should probably be TERM_PUBLIC, which evaluates to static. |
|
From: Per P. <per...@ma...> - 2005-05-15 18:31:20
|
On May 11, 2005, at 21:18, Hans-Bernhard Broeker wrote: > Brendan Burns wrote: > >> In file included from term.h:400, >> from term.c:1205: >> ../term/pslatex.trm:120: error: static declaration of >> 'epslatex_header' follows non-static declaration >> ../term/post.h:88: error: previous declaration of >> 'epslatex_header' was here >> > > That's strange --- this is usually just a warning, not an error. > Did GCC change its behaviour on this? > > >> Changing >> "static char *epslatex_header..." -> "char *epslatex_header..." >> in pslatex.trm fixed the compile error. >> > > It's quite probably the wrong direction of change, though. Making > the declaration in post.h 'static' makes more sense. Actually, it > should probably be TERM_PUBLIC, which evaluates to static. I'm on 10.4 now and the following change to post.h seems to fix the build problems: Index: term/post.h =================================================================== RCS file: /cvsroot/gnuplot/gnuplot/term/post.h,v retrieving revision 1.7 diff -u -d -b -w -r1.7 post.h --- term/post.h 2 Mar 2005 19:44:57 -0000 1.7 +++ term/post.h 15 May 2005 18:20:22 -0000 @@ -85,6 +85,6 @@ #define EPSLATEX_HCHAR (11*PS_SC*6/10) /* additional LaTeX header information for epslatex terminal */ -extern char *epslatex_header; +TERM_PUBLIC char *epslatex_header; #endif /* TERM_POST_H */ Am I right in assuming that using the 'extern' qualifier in post.h, which will be pulled into term.c with the rest of the terminal stuff, was never strictly correct and that gcc 4.0 now returns an error? Should I commit this change? /Per |
|
From: Ethan M. <merritt@u.washington.edu> - 2005-05-15 19:18:02
|
On Sunday 15 May 2005 11:31 am, Per Persson wrote: > I'm on 10.4 now and the following change to post.h seems to fix the > build problems: > > --- term/post.h 2 Mar 2005 19:44:57 -0000 1.7 > +++ term/post.h 15 May 2005 18:20:22 -0000 > @@ -85,6 +85,6 @@ > #define EPSLATEX_HCHAR (11*PS_SC*6/10) > /* additional LaTeX header information for epslatex terminal */ > -extern char *epslatex_header; > +TERM_PUBLIC char *epslatex_header; > #endif /* TERM_POST_H */ It should be defined consistently, so please change it to TERM_PUBLIC in pslatex.trm also: =========================================================================== --- gnuplot/term/pslatex.trm 2005-05-09 22:51:37.000000000 -0700 +++ gnuplot-cvs/term/pslatex.trm 2005-05-15 12:10:49.937075896 -0700 @@ -99,6 +99,9 @@ TERM_PUBLIC void EPSLATEX_put_text __PROTO((unsigned int x, unsigned int y, const char *str)); TERM_PUBLIC void EPSLATEX_linetype __PROTO((int linetype)); +/* additional LaTeX header information for epslatex terminal */ +TERM_PUBLIC char *epslatex_header = NULL; + #endif /* TERM_PROTO */ @@ -116,9 +119,6 @@ static struct pstex_text_command *pstex_labels = NULL; -/* additional LaTeX header information for epslatex terminal */ -static char *epslatex_header = NULL; - /* Common functions for epslatex and ps(la)tex */ =========================================================================== > Am I right in assuming that using the 'extern' qualifier in post.h, > which will be pulled into term.c with the rest of the terminal stuff, > was never strictly correct and that gcc 4.0 now returns an error? It was never correct, insofar as this variable was never needed outside of the terminal drivers. But I don't see how gcc could know that. gcc is just complaining that the two declarations, static and extern, are inconsistent. -- Ethan A Merritt Biomolecular Structure Center University of Washington 98195-7742 |
|
From: Ethan M. <merritt@u.washington.edu> - 2005-05-15 22:42:47
|
On Sunday 15 May 2005 02:07 pm, you wrote: > > TERM_PROTO is for *declarations*, not for definitions. OK, sorry. But I don't quite follow the distinction you are making. This is indeed a declaration, not a definition, at least as I understand the terms. It looks like there are similar declarations in the TERM_PROTO sections of gd.trm, ggi.trm, linux.trm, and mif.trm. Do you want these moved as well? -- Ethan A Merritt Biomolecular Structure Center University of Washington 98195-7742 |
|
From: Hans-Bernhard B. <br...@ph...> - 2005-05-15 22:53:11
|
Ethan Merritt wrote: > But I don't quite follow the distinction you are making. > This is indeed a declaration, not a definition, at least as > I understand the terms. It looks like there are similar > declarations in the TERM_PROTO sections of gd.trm, ggi.trm, > linux.trm, and mif.trm. Do you want these moved as well? Yes. To quote term/README: The bit in the PROTO section is basically what you would put into a .h file if we had them - everything that is needed by the TABLE_ENTRY should be defined in this part. In particular, don't forget all the maxes and character sizes and things for the table entry. Definitions don't belong in headers, so they don't belong into the TERM_PROTO section either. -- Hans-Bernhard Broeker (br...@ph...) Even if all the snow were burnt, ashes would remain. |