This is the mail archive of the
mailing list for the GCC project.
Re: PATCH COMMITTED: EXPORTED_CONST
- From: Jay Foad <jay dot foad at gmail dot com>
- To: gcc-patches at gcc dot gnu dot org
- Cc: iant at google dot com
- Date: Thu, 4 Jun 2009 06:51:32 +0100
- Subject: Re: PATCH COMMITTED: EXPORTED_CONST
> +/* This is used to declare a const variable which should be visible
> + outside of the current compilation unit. Use it as
> + EXPORTED_CONST int i = 1;
> + This is because the semantics of const are different in C and C++.
> + "extern const" is permitted in C but it looks strange, and gcc
> + warns about it when -Wc++-compat is not used. */
You can't use this for variables of pointer type, can you, because
EXPORTED_CONST char *p = ...;
will give you a pointer to const char, not a const pointer to char. Is
that not a problem in practice?