This is the mail archive of the cygwin-patches mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Declaration of crypt


On 06/09/2016 08:07 AM, Ken Brown wrote:
> On 6/9/2016 8:32 AM, Corinna Vinschen wrote:
>> Can you please define crypt, encrypt and setkey explicitely in unistd.h
>> per POSIX, rather than including crypt.h?  This would not only be target
>> independent, it would also be more correct.  As a side effect I will
>> have to come up with a new version of the crypt package, because our
>> crypt.h is using a wrong prototypes for setkey (const is missing).
> 
> setkey is supposed to be in stdlib.h rather than unistd.h, so I've done
> that.
> 
> One minor question about encrypt: The Posix prototype has 'char
> block[64]' as the first argument, but Cygwin's crypt.h simply has 'char
> *block'.  FreeBSD and glibc also use 'char *block', so I did the same.

The two are identical, according to C rules.  Using [64] rather than *
gives a bit more indication about the size of the array that must be
passed, but doesn't change the compiler behavior.

> Or would you rather follow Posix here?
> 
>> Thanks a lot and sorry again,
> 
> No problem.  Revised patch attached.
> 
> Ken
> 

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]