[CentOS] upgrade problem

Tue Sep 20 16:18:44 UTC 2005
Brian T. Brunner <brian.t.brunner at gai-tronics.com>

My mailer has no quoted-text-prefix capability.
***embedded replies***

Brian Brunner
brian.t.brunner at gai-tronics.com
(610)796-5838

>>> mike.mccarty at sbcglobal.net 09/20/05 11:16AM >>>
Brian T. Brunner wrote:
> My desire is NOT to remain rooted in the past.  Hence 
> my interest in changing my code to meet the compiler of today.

You should not use what some compiler accepts as your
guide for writing code. You should use the Language Definition.

***pedantic*** I have to get the compiler to compile the code, the language definition won't do that.
***pragmatic*** I'm here to drain the swamp, not analyze the alligators.
***overall** How did the compilers change in what they tolerate.

See below.

> If I'm killing the 3.x compiler with code that 2.96 accepted,
> it ought to be from well-known (by now) reasons like 
> 

Also, the C Language did not recently change.

***the compiler is the  cop, the language definition is the law***

> Known problem and solution: (amended to clarify my mumbling, for which I apologize)
> 
> We have typedef char MsgIdT 
> We use a message that is a union comprising a 
> MsgIdT MsgId;
> and the 
> 117 message structures, (each of which has a MsgIdT MsgId as the first element);
> we had a null message number macro #define MSG_NULL ((MsgIdT)0)
> under 2.96 we could allocate a message union, and initialize it with
> union msgstructT msg = {MSG_NULL};  // the 3.x compiler barfs on this but 2.96 didn't care
> so now we say
> union msgstructT msg = {0};                // the 3.x compiler is happy with this.  So is 2.96
> 
> Why the compiler decided we can't initialize an auto union with a 
> type-cast scalar when we used to do so with no problem
> *should* have been recorded somewhere, if so, that document
> *should* give me other clues about what's making the 3.x compiler 
> barf on this 2.96-happy code.

Your guide to writing proper code should not be what a
compiler accepts, but what the language definition specifies.

***the compiler creates the marketable product, that's what I have to please.***
***As a theorist, the C and C++ language definitions (law) are fascinating***
***As an engineer porting 2.96 code to a 3.4 compiler, the (get this)***
***LANGUAGE DEFINITION IS UTTERLY IRRELEVANT***
***I've met plenty of cops to whom the law is irrelevant, we do things his way or there's trouble.***
***the compiler is my cop.  He's the one I have to please.***

gcc --ansi --pedantic -Wall

to get maximum conformance and portability of my code.

***this is what I inherited:
***COMPILER_OPTIONS = -D_GCC_ -g -g3 -pipe -march=i586 -fstack-check -fcse-follow-jumps -fexpensive-optimizations -fcse-skip-blocks -fforce-mem -frerun-cse-after-loop -fschedule-insns -fschedule-insns2 -fshort-enums -fstrength-reduce -fthread-jumps -fverbose-asm -O2 -Wall -Waggregate-return -Wcast-align -Wcast-qual -Wconversion -Winline -Wpointer-arith -Wshadow -Wwrite-strings
*** probably more than I need, I might take a (sub) project of stripping this list down to just those needed to get in-spec performance of the object code.
** neither ansi nor pedantic are currently in the list of options.

should be reported as a defect.

***My mission is to get the code running under the new compiler.  The code pleased the 2.96 compiler.  Things worked!
***Now, the new compiler is really displeased with my code.
***I'd like to know what the differences are in the two compiler versions relative to what (possibly) non-conforming code is no longer tolerated.

*******************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.

This footnote also confirms that this email message has been swept
for the presence of computer viruses.

www.hubbell.com - Hubbell Incorporated