mailing list of musl libc
 help / color / mirror / code / Atom feed
* Maybe not a bug but a possible omission?
@ 2018-03-28 10:31 Jon Scobie
  2018-03-28 12:52 ` CodingMarkus
  0 siblings, 1 reply; 7+ messages in thread
From: Jon Scobie @ 2018-03-28 10:31 UTC (permalink / raw)
  To: musl; +Cc: Tom Cosgrove, Jason Page, Sam Carroll

[-- Attachment #1: Type: text/plain, Size: 2210 bytes --]

Hi. We are currently using musl in the context of Alpine 3.7 in a docker
container.
The application in question I am writing is in golang (1.9.4) but I have to
interface to some in house cryptographic libraries we write in C.
To help us achieve this with the minimal of fuss and also to generate
bindings to other languages, I am using SWIG 3.0.12.

I have come across a couple of issues which do not appear when using glibc
and they both centre on stdint.h

If I include <stdint.h> as part of the swig interface and it tries to wrap
it, it fails on the wrapper compilation of #defines for anything using
INT64_MIN, INT64_MAX etc.

Initially, I thought this was to do with the swig definitions for 64 bit
but on looking at the code and comparing what glibc defines for this, it
boiled down to the rvalue definitions for these macros.
Basically, glibc wraps these with another macro so where we have the
definition in musl as :-

#define INT64_MIN  (-1-0x7fffffffffffffff)

the equivalent glibc definition is the equivalent of

#define INT64_MIN  (-1-0x7fffffffffffffffL)

The issue is that swig has no idea what type INT64_MAX is if you don't
specifically state what it is so it treats it as a goint - which is not a
long (or long long).

Is there any value in changing the musl definitions of these so they are
precise in their definition or have I missed something?


A slightly different issue (and one which might be more a swig issue than
musl, although it works on glibc) is the definitions for WCHAR_MAX and
WCHAR_MIN.
On glibc, these are defined as whole values and not as 0xffffffffu+L'\0',
for example.

The wrappers end up messing these up as they escape all the back ticks and
this is not correct. As I said, a possible issue in swig based on a side
effect which doesn't exist when using glibc with these definitions.

Interested in hearing any opinion on this.

Regards,

Jon Scobie

-- 

----
The information contained in this communication is private and confidential 
and may contain privileged material. It is intended solely for use by the 
recipient(s). Copying, distributing, disclosing or using any of the 
information in it or any attachments is strictly prohibited and may be 
unlawful.

[-- Attachment #2: Type: text/html, Size: 2825 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2018-03-29  4:53 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-28 10:31 Maybe not a bug but a possible omission? Jon Scobie
2018-03-28 12:52 ` CodingMarkus
2018-03-28 13:33   ` Jon Scobie
2018-03-28 17:19     ` Szabolcs Nagy
2018-03-28 17:54       ` Rich Felker
2018-03-29  0:30         ` Jon Scobie
2018-03-29  4:53           ` Markus Wichmann

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).