Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <1416926756.16006.922.camel@eris.loria.fr>
Date: Tue, 25 Nov 2014 15:45:56 +0100
From: Jens Gustedt <jens.gustedt@...ia.fr>
To: musl@...ts.openwall.com
Subject: type verification for number macros

Hello,

after a recent discussion about DR 456, I noticed that the types and
properties of the numerical macros that the C standard requires are
not always completely trivial. Basically there are three distinct
cases:

  (1) the standard requires that the type of an integer constant is the
      promoted type

  (2) the standard requires that the type of an integer constant is the
      exact type

  (3) the standard requires that the type of a floating point constant
      is the exact type *and* that it must be suitable to initialize a
      static varialble.

Joint is a program that checks all of these. This exposes 3 different
bugs for musl:

  - [U]INTxx_C(x) macros don't have the exact type
  - WINT_MIN must have type wint_t, that is unsigned for musl
  - CMPLX(x, y) and friends must be usable for initialization

The later makes the compilation of the program fail with musl :(

In a follow up I will send 4 patches that address issues with this
types of macros.

Jens


-- 
:: INRIA Nancy Grand Est ::: AlGorille ::: ICube/ICPS :::
:: ::::::::::::::: office Strasbourg : +33 368854536   ::
:: :::::::::::::::::::::: gsm France : +33 651400183   ::
:: ::::::::::::::: gsm international : +49 15737185122 ::
:: http://icube-icps.unistra.fr/index.php/Jens_Gustedt ::



View attachment "test_number_macros.c" of type "text/x-csrc" (22788 bytes)

Download attachment "signature.asc" of type "application/pgp-signature" (199 bytes)

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.