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

Re: Please test: scrypt 1.2.99

On 2019-07-01 09:04, Graham Percival wrote:
> On Mon, Jul 01, 2019 at 10:07:08AM -0400, James Turner wrote:
>> On Mon, Jul 01, 2019 at 10:04:28AM -0400, James Turner wrote:
>>> On Sun, Jun 30, 2019 at 09:43:34PM -0700, Colin Percival wrote:
>>> In file included from libcperciva/alg/sha256.c:7:
>>> libcperciva/alg/sha256_shani.h:14: error: static or type qualifiers in abstract declarator
>> I should have noted that was under gcc (GCC) 4.2.1 20070719. If I change
>> CC to the default clang, everything compiles just fine under OpenBSD.

Does this problem go away if you add -std=c99 to CFLAGS?

> I remember seeing those before, but I can't immediately find the github issue.
> The problem is that gcc 4.2.1 doesn't fully support C99.  The code in question
> is:
> static void SHA256_Transform(uint32_t[static restrict 8],
>     const uint8_t[static restrict 64], uint32_t[static restrict 64],
>     uint32_t[static restrict 8]);
> which uses the [] new features in C99.  (Or rather, these were "new" features
> 20 years ago.)

We worked around a problem with some compilers which didn't understand
'restrict' unless they were passed -std=c99, but I don't remember running
into systems which specifically failed with qualifiers in a function

If -std=c99 fixes this, we should adjust posix-restrict.c.

Colin Percival
Security Officer Emeritus, FreeBSD | The power to serve
Founder, Tarsnap | www.tarsnap.com | Online backups for the truly paranoid