This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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?

Thanks,
Jay.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]