Re: [eigen] Dev branch: Name clash with termios system header

[ Thread Index | Date Index | More lists.tuxfamily.org/eigen Archives ]


2009/9/18 Adolfo Rodríguez <dofo79@xxxxxxxxx>:
> Hi all,
>
> We recently updated from the stable to the development branch of eigen to
> try out the new SVD implementations. In doing so we encountered a nasty name
> clash, which is not eigen's fault, but for archival purposes I think it's
> good to comment it here on the list, just in case someone else bumps into
> it.
>
> It turns out that including termios.h (definitions used by the terminal I/O
> interfaces) defines the macro B0 (specific offending header:
> bits/termios.h), which incidentally is a local variable in
> Core/products/GeneralBlockPanelKernel.h. We currently get away with the
> situation by undefing B0 in the corresponding file, but this is an ugly hack
> in the long run. Since there is no chance that those legacy termios macros
> will change, could it be possible to rename the temporaries in
> Core/products/GeneralBlockPanelKernel.h to slightly less generic names?
> (prepending/appending 1-2 characters should be enough).

This isn't the first time that we have to #undef very polluting
symbols from standard headers: we already have to undef "vector" from
Apple's altivec.h, and "minor" from the GNU libc headers, among
others.

bits/termios.h isn't a C++ header, it's a C header, so in fact it's
just an "accident" that you can use it in C++, so i'll just #undef B0.

FYI, in C++, the reserved symbols that the standard library may claim
must start  _ and then a capital letter, e.g. _B0.

Benoit

>
> Thanks in advance,
>
> Adolfo.
>
>
>
>
> --
> Adolfo Rodríguez Tsouroukdissian, Ph. D.
>
> Robotics engineer
> PAL ROBOTICS S.L
> http://www.pal-robotics.com
> Tel. +34.93.414.53.47
> Fax.+34.93.209.11.09
> AVISO DE CONFIDENCIALIDAD: Este mensaje y sus documentos adjuntos, pueden
> contener información privilegiada y/o confidencial que está dirigida
> exclusivamente a su destinatario. Si usted recibe este mensaje y no es el
> destinatario indicado, o el empleado encargado de su entrega a dicha
> persona, por favor, notifíquelo inmediatamente y remita el mensaje original
> a la dirección de correo electrónico indicada. Cualquier copia, uso o
> distribución no autorizados de esta comunicación queda estrictamente
> prohibida.
>
> CONFIDENTIALITY NOTICE: This e-mail and the accompanying document(s) may
> contain confidential information which is privileged and intended only for
> the individual or entity to whom they are addressed.  If you are not the
> intended recipient, you are hereby notified that any disclosure, copying,
> distribution or use of this e-mail and/or accompanying document(s) is
> strictly prohibited.  If you have received this e-mail in error, please
> immediately notify the sender at the above e-mail address.
>



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/