Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Fri, 8 Feb 2013 23:52:38 +0100
From: magnum <john.magnum@...hmail.com>
To: john-dev@...ts.openwall.com
Subject: Re: C for dummies

On 8 Feb, 2013, at 23:30 , Solar Designer <solar@...nwall.com> wrote:
> On Fri, Feb 08, 2013 at 02:18:07PM -0600, jfoug wrote:
>> From: magnum [mailto:john.magnum@...hmail.com] 
>>> In common.c we have several lines like this:
>>> 
>>> char itoa16u[16] = "0123456789ABCDEF";
>>> 
>>> Is this a bug or not?
> 
> As I found out previously:
> In C, no.  In C++, yes.
> 
> In OpenCL, I don't know.

Interesting. I had a gut feeling I should ask about it and I failed producing rational search terms for google. OpenCL is supposed to be C90 so I guess it's a bug in AMD's compiler then.

> As to the addition of const, I fully agree - we should be adding them in
> such places.

I'll do that. BTW I always wondered why things like "set_key(char *key, int index)" are not declaring key as const? Would that not let the compiler do better optimizations in some cases (apart from detecting bugs)? Or do I over estimate the value of const in that case?

magnum

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.