|
From: | Jonathan Kinsey |
Subject: | Re: [Bug-gnubg] FormatMoves |
Date: | Wed, 9 Jun 2010 15:30:34 +0000 |
The C compiler isn't very good at consts, the typedef ConstTanBoard should be used if it isn't changed. Jon On 09/06/2010 12:56, Thomas A. Moulton wrote: > I'll dig deeper. > > I hate needless warnings... > > Maybe I am a purist, but I like things better when they compile without > warnings > > Tom -Wall --strict > > Christian Anthon wrote: >> const in C is an aid to help the programmer to keep track of data that >> shouldn't be modified by a function. If you can add a const without >> the compiler complaining, fine, if you can't don't, unless you are >> ready to track down exactly where the data may and may not be >> modified. The compiled program won't change, regardless of the const. >> >> Christian. >> >> On Tue, Jun 8, 2010 at 12:37 PM, Thomas A. Moulton >> wrote: >> >>> Code question >>> >>> extern char *FormatMove( char *pch, const TanBoard anBoard, int >>> anMove[ 8 ] >>> ); >>> extern char *FormatMovePlain( char *pch, TanBoard anBoard, int >>> anMove[ 8 ] >>> ); >>> >>> They appear to be interchangable. >>> >>> should they both have "const TanBoard anBoard" ? >>> (or neither?) >>> >>> tom >>> >>> >>> _______________________________________________ >>> Bug-gnubg mailing list >>> address@hidden >>> http://lists.gnu.org/mailman/listinfo/bug-gnubg >>> >>> >> >> >> > > _______________________________________________ > Bug-gnubg mailing list > address@hidden > http://lists.gnu.org/mailman/listinfo/bug-gnubg > > Get a free e-mail account with Hotmail. Sign-up now. |
[Prev in Thread] | Current Thread | [Next in Thread] |