[Tinycc-devel] Patch: add option -mms-bitfields

2016-11-22 Thread David Mertens
Hello everyone, Per previous discussion, here is a patch to implement a command-line option, -mms-bitfields. This would alter tcc's bitfield alignment algorithm in a backwards-incompatible way to be a bit more consistent with gcc's algorithm. The old behavior is traditionally attributed to MSVC,

Re: [Tinycc-devel] Patch: add option -mms-bitfields

2016-11-22 Thread Michael B. Smith
Speaking only to my personal opinion – if you are compiling on Windows, and the –mms-bitfields is not set and –no-ms-bitfields is not set, then you should issue a warning to that effect. From: Tinycc-devel [mailto:tinycc-devel-bounces+michael=theessentialexchange@nongnu.org] On Behalf Of

Re: [Tinycc-devel] Weird bitfield size handling, discrepancy with gcc

2016-11-22 Thread David Mertens
Hello avih, In short, very little is expected to break. Very few libraries present a public API susceptible to this sort of problem. The linked discussion mentions that this could be an issue with GTK+ v2, which apparently exposes these sorts of bitfields in its public API. Obviously parts of the

Re: [Tinycc-devel] Patch: add option -mms-bitfields

2016-11-22 Thread David Mertens
Now this idea I like, a lot, in terms of forcing users to understand what they're dealing with. This would also give impetus to our Windows folks to update configure for more sensible the default selection behavior. Thanks! Other thoughts? David On Tue, Nov 22, 2016 at 4:41 PM, Michael B. Smith

Re: [Tinycc-devel] Patch: add option -mms-bitfields

2016-11-22 Thread Richard Brett
If you're asking opinions I would rather the default is set -mms-bitfields if compiling on Windows, and -no-mms-bitfields (?) on Linux. That way there is no breaking change for some Windows users. Then the only impact would be to non MSVC users on Windows who are wanting to share

Re: [Tinycc-devel] Weird bitfield size handling, discrepancy with gcc

2016-11-22 Thread David Mertens
Hello, Folks have been using tcc on linux for years and have not reported this as an issue. Juding from the evidence, the situations where this is problematic are vanishingly small. That's because it is only an issue when a library presents the following sort of struct as part of its public api:

Re: [Tinycc-devel] Weird bitfield size handling, discrepancy with gcc

2016-11-22 Thread avih
Thanks for the detailed reply. I haven't yet read the linked discussion, but I will. I like that it will work better on Linux, but the latter part of my question was intended to understand better what would stop working on Windows if you take approach #1 but the flag isn't used when invoking