nano-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Nano-devel] merged patch


From: Gareth Pearce
Subject: Re: [Nano-devel] merged patch
Date: Fri, 22 Feb 2002 04:27:26

On Thu, Feb 21, 2002 at 02:09:17PM -0800, Steven Kneizys wrote:
> Hi,
>
> I got most of the merged patch to go in easily using a lil fuzz and
> installing the gnu patch 2.5.4 (of course the native patch program
> didn't understand the patch!), except my native compiler on the Compaq
> Alpha Unix 4.0d has a lil problem with some new stuff:
>
> cc: Error: files.c, line 329: In the declaration of "cnum",
> "max_int_digits" is not constant, but occurs in a context that requires
> a constant expression.
>     char cnum[max_int_digits + 2];
> --------------^
> cc: Error: files.c, line 330: In the declaration of "buf",
> "strlen(...)" is not constant, but occurs in a context that requires a
> constant expression.
>     char buf[strlen(name) + max_int_digits + 2];
> -------------^
> cc: Error: files.c, line 330: In the declaration of "buf",
> "max_int_digits" is not constant, but occurs in a context that requires
> a constant expression.
>     char buf[strlen(name) + max_int_digits + 2];
> ----------------------------^

Ack, I'm surprised gcc lets this go through without a complaint.  I dont
think this type of declaration is portable.  I'll try and bang on this
patch this weekend, there just seems to be something about it...it seems
like we're doing an awful lot of memory allocations.  Considering the
program is (in theory) exiting with abnormal status I would tend to try
and keep the malloc()ing to a minimum.  Let me have a look.

while indeed probably want to keep malloc()ing to a minimum - if my memory serves me correctly - the above code is perfectly valide c ... but only under the c99 standard (or c++-like-c) and gcc probably has supported it before the c99 standard in any case - gcc is like that. osf 4.0d happens to be a 1997 compiler - so I am not supprised it complains. Ofcourse its been a few months since i read the standard.

Gareth - who recently gained access to a set of osf boxes 4.0d e and f - and is hating just about everything about them :)


Chris A
--
Chris Allegretta        http://www.asty.org

"Share and Enjoy" - Douglas Adams, 1952 - 2001

_______________________________________________
Nano-devel mailing list
address@hidden
http://mail.gnu.org/mailman/listinfo/nano-devel




_________________________________________________________________
Chat with friends online, try MSN Messenger: http://messenger.msn.com




reply via email to

[Prev in Thread] Current Thread [Next in Thread]