reviving games/freebsd-games

clemens fischer ino-news at spotteswoode.dnsalias.org
Tue Oct 28 14:08:31 PDT 2008


On Tue, 28 Oct 2008 13:03:32 +0100 clemens fischer wrote:

> On Tue, 28 Oct 2008 11:57:15 +0100 Jurjen Middendorp wrote:
>
>> If you do char *p = "something", you can't write to that string
>> (it's a pointer into some stringtable: easy way to look at it
>> :). You have to use char p[] = "something", then it's an array
>> with enough storage to write to :) maybe try something like char
>> scrollname[NUMSCROLLS][]; ?

this type of declaration evokes "array type has incomplete element
type", which is seen as compliant behaviour by gcc experts.  so this is
a no go.

> I thought I'd clean up that code declaring a real struct like:
> 
>  struct scrollname_s {
>      int active;
>      char name[] = "...";
>  };

this is what i actually did.  it makes the code way more easier to read
and keep.

> then name could stay read-only.  OTOH I found numerous larn versions,
> so keeping ours "compatible" might keep maintenance costs down.

I'd still be interested in what others did.

-c



More information about the freebsd-questions mailing list