Re: [AD] 3.9.34 release date? (args)

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


In message <Pine.LNX.4.30.0101102305400.554-100000@xxxxxxxxxx>, Stepan Roh wri
tes:
>On Wed, 10 Jan 2001 stephen.kittelson@xxxxxxxxxx wrote:
>
>> On Wed, 10 Jan 2001 13:56:07 +0000 Olly Betts <olly@xxxxxxxxxx> writes:
>> > Here's a patch for a minor bug.  The code which parses the
>> > command-line into argv and argc for MS Windows doesn't add a
>> > terminating NULL value to argv. You won't notice if you use argc to
>> > stop reading, but will if you iterate through argv until you hit a NULL
>> > entry.
>>
>> So why not just use `argc'?

I was just trying to explain why nobody has noticed this problem before.
Programmers will expect both methods to work, and it's not reasonable to
expect them to change valid code when the fix to make allegro get it right
is so simple.

>argv ending with NULL is in POSIX standard (derived from Unix and
>implemented by its clones and also Windows NT claims to follow it) and
>this convention is widely used.

It's actually part of the ANSI/ISO C standard.  It's possible POSIX also
requires it.

I have heard that some pre-ANSI C compilers didn't set argv[argc] to NULL
but Allegro really should.

Cheers,
Olly



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/