Usage of ANSI-C |const| in X11 code...
Roland Mainz
roland.mainz at nrubsig.org
Sat Mar 12 10:51:22 PST 2005
Paul Vojta wrote:
> > Are there still any problems which forbids code to use the ANSI-C
> > |const| modifer ? Looking at the code lots of places could employ the
> > |const| keyword to save some memory at runtime...
> > ... if there aren't any problems left (AFAIK the tree now requires at
> > least C89 which includes |const| support) then I'd like to do some
> > cleanup...
>
> X has been using _Xconst for a long time...
Yeah, but note the underscore (indicating that it's more some
(semi-)private stuff) - |_Xconst| is more a hack for the old days when
K&R compilers needed to be supported. Since a while ANSI-C89 support is
the minimum required and some code in libX11, Xserver and other places
already uses |const| without causing complains. So my question is
whether code can now "officially" use |const| directly (CC:'ing
xorg-arch at lists.x.org as this is more an architecture question, IMO we
need need a clear statement that ANSI-C89 is now the minimum level and
all it's features[1] can be used by Xorg code) ...
[1]=Next question would be whether the |inline| keyword can be used in
Xorg code - |inline| is newer than ANSI C89 (maybe C99 but I am not
sure) but most compilers incl. gcc, Sun Workshop/Forte/One and the MS
compiler support it right now...
----
Bye,
Roland
--
__ . . __
(o.\ \/ /.o) roland.mainz at nrubsig.org
\__\/\/__/ MPEG specialist, C&&JAVA&&Sun&&Unix programmer
/O /==\ O\ TEL +49 641 7950090
(;O/ \/ \O;)
More information about the xorg-arch
mailing list