public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Feature Request for C
@ 2017-05-06 17:09 Taylor Holberton
  2017-05-08 11:00 ` Florian Weimer via gcc
  0 siblings, 1 reply; 2+ messages in thread
From: Taylor Holberton @ 2017-05-06 17:09 UTC (permalink / raw)
  To: gcc

Hello!

I would like to know if adding namespaces for the C language (as a gnu
extension) could be added in GCC.
Except instead of using c++ style mangling, it would simply just
prepend the name of the namespace to the symbols in the file.
For example:

_Namespace ncurses_
{

int savetty(void);

}

Would be exported as ncurses_savetty, and could be called outside of
the namespace as:

ncurses_savetty();

This would ease the maintenance of a lot of existing C projects that
use this kind of naming convention.

-- 
Taylor Holberton
Petaluma, CA

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Feature Request for C
  2017-05-06 17:09 Feature Request for C Taylor Holberton
@ 2017-05-08 11:00 ` Florian Weimer via gcc
  0 siblings, 0 replies; 2+ messages in thread
From: Florian Weimer via gcc @ 2017-05-08 11:00 UTC (permalink / raw)
  To: Taylor Holberton, gcc

On 05/06/2017 07:09 PM, Taylor Holberton wrote:
> Except instead of using c++ style mangling, it would simply just
> prepend the name of the namespace to the symbols in the file.

Would this also apply to type names and struct tags?  How does it 
interfere with the name resolution in the body of inline functions?

Personally, I don't think we need to duplicate more things from C++ into 
C as GNU extensions.  If you want C++ features, just use a C++ subset.

Florian

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-05-08 11:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-06 17:09 Feature Request for C Taylor Holberton
2017-05-08 11:00 ` Florian Weimer via gcc

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).