EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

1994  1995  1996  1997  <19981999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024  Index 1994  1995  1996  1997  <19981999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Re: beta12 & GPIB & Compiler Bug
From: Benjamin Franksen <[email protected]>
To: Marty Kraimer <[email protected]>, [email protected]
Cc: Bill Brown <[email protected]>
Date: Mon, 28 Sep 1998 13:53:57 +0200
Marty Kraimer wrote:
> 
> GPIB device support which is implemented by starting the John Winan's
> template
> has the statements:
> 
> static struct devGpibParmBlock devSupParams;
> 
> ...
> 
> static struct devGpibParmBlock devSupParams = {
> ...
> };
> 
> Note that this is legal ISO C but is not legal C++

I searched the 'bible' (K&R: The C Programming Language) and found no
hint as to what the result of this should be. If one judges according to
logic, the compiler should reject that as a multiple definition error.
But in reality it seems the compiler believes that the first definition
is meant as a declaration (even without 'extern' keyword) and so accepts
it.

However, IMO it is better to prefix the _declaration_ with 'extern'
instead of 'static', i.e.

extern struct devGpibParmBlock devSupParams;

static struct devGpibParmBlock devSupParams = {
...
};

The inconsistences you observed with different compiler versions should
disappear then. I'd vote for changing the skeleton file accordingly.
(The fact that the gcc from vxworks 5.3 has a bug remains of course
untouched by these remarks.)

Bill:

Sorry for not answering, I've been in Greece on vaccation. I don't think
the two problems are related. I'll send you specific info as soon as I
have examined problem more thoroughly.

Ben
-- 
The Notorious Neb Nesknarf
---------------------------------------------------------------------
@BESSY II: fax: +49 30 6392-4859 phone: +49 30 6392-4865
---------------------------------------------------------------------
make sure useless people get employment: BND MAD Waffen Lieferung ETA
Lybien Irak Iran CIA killer Heroin Befreiungsfront IRA RAF PKK Kurden

Replies:
Re: beta12 & GPIB & Compiler Bug Marty Kraimer
References:
beta12 & GPIB & Compiler Bug Marty Kraimer

Navigate by Date:
Prev: Re: where to find PMAC Controller support ? Andy Foster
Next: Re: MBBI & mask Paul Sichta
Index: 1994  1995  1996  1997  <19981999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: beta12 & GPIB & Compiler Bug Marty Kraimer
Next: Re: beta12 & GPIB & Compiler Bug Marty Kraimer
Index: 1994  1995  1996  1997  <19981999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 10 Aug 2010 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·