Re: [Tinycc-devel] Attributes position on structs/unions

2016-04-07 Thread Vladimir Vissoultchev
Btw, current -dD option is not documented in tcc-doc.texi and I'm not sure
how to proceed for the new -dM one.

>From here https://gcc.gnu.org/onlinedocs/gcc/Preprocessor-Options.html on
-dCHARS

> -dCHARS
>   CHARS is a sequence of one or more of the following characters, and must
not
>   be preceded by a space. Other characters are interpreted by the compiler

>   proper, or reserved for future versions of GCC, and so are silently
ignored.
>   If you specify characters whose behavior conflicts, the result is
undefined.
>
>   'M'
>   Instead of the normal output, generate a list of '#define'
directives 
>   for all the macros defined during the execution of the preprocessor,

>   including predefined macros. This gives you a way of finding out
what is
>   predefined in your version of the preprocessor. Assuming you have no

>   file foo.h, the command
>
>   touch foo.h; cpp -dM foo.h
>
>   will show all the predefined macros.
>
>   If you use -dM without the -E option, -dM is interpreted as a
synonym 
>   for -fdump-rtl-mach. See Developer Options. 
>
>   'D'
>   Like 'M' except in two respects: it does not include the predefined 
>   macros, and it outputs both the '#define' directives and the result
of 
>   preprocessing. Both kinds of output go to the standard output file.

tcc does not silently ignore anything different that `M` and `D` but
terminates with an error. `D` seems to include
predefines macros too. There is no -dM without -E too.

cheers,



___
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel


Re: [Tinycc-devel] Attributes position on structs/unions

2016-04-07 Thread Vladimir Vissoultchev
Sorry about the links. Here is the patch and two other small fixes I'm
proposing: First is to impl -dM preprocessor option to dump defines only
and the second is on -lm to skip math lib altogether as there is no built-in
math lib in tcc as far as I can see.

Commit links on github are
https://github.com/wqweto/tinycc/commit/e946eb2a4109e0de5f8514457f851897a482
4c3e
and
https://github.com/wqweto/tinycc/commit/12ee3348df927a2b4ab392b7a19ed0326b22
2f4c

cheers,


-Original Message-
From: tinycc-devel-bounces+wqweto=gmail@nongnu.org
[mailto:tinycc-devel-bounces+wqweto=gmail@nongnu.org] On Behalf Of
Michael Matz
Sent: Wednesday, April 6, 2016 10:12 PM
To: tinycc-devel@nongnu.org
Subject: Re: [Tinycc-devel] Attributes position on structs/unions

Hi,

On Wed, 6 Apr 2016, Vladimir Vissoultchev wrote:

> https://github.com/wqweto/tinycc/commit/0691b7630b89bf3de5f7691802cb92
> 3bd7c1
> fd99

Thanks, please push to mob.  (It would be easier to review if you'd include
the patch in plain text in your email.  I for instance use a console based
MUA, so opening URLs is a small hassle.)


Ciao,
Michael.

___
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel


0001-tccgen.c-Allow-type-attributes-to-prefix-enum-struct.patch
Description: Binary data


0002-Implement-dM-preprocessor-option-as-in-gcc.patch
Description: Binary data


0003-Skip-math-library-when-parsing-lm-option.patch
Description: Binary data
___
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel


Re: [Tinycc-devel] Attributes position on structs/unions

2016-04-06 Thread Michael Matz

Hi,

On Wed, 6 Apr 2016, Vladimir Vissoultchev wrote:


https://github.com/wqweto/tinycc/commit/0691b7630b89bf3de5f7691802cb923bd7c1
fd99


Thanks, please push to mob.  (It would be easier to review if you'd 
include the patch in plain text in your email.  I for instance use a 
console based MUA, so opening URLs is a small hassle.)



Ciao,
Michael.

___
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel


[Tinycc-devel] Attributes position on structs/unions

2016-04-06 Thread Vladimir Vissoultchev
https://github.com/wqweto/tinycc/commit/0691b7630b89bf3de5f7691802cb923bd7c1
fd99

 

A small fix for compat w/ gcc which allows `attributes` both to prefix and
postfix type declaration like this:

 

typedef union Unaligned16a {

  uint16_t u;

  uint8_t b[2];

} __attribute__((packed)) Unaligned16a;

 

typedef union __attribute__((packed)) Unaligned16b {

  uint16_t u;

  uint8_t b[2];

} Unaligned16b;

 

This failing sample included in tests.

 

cheers,



___
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel