public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "marc dot glisse at normalesup dot org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug libstdc++/30928] add casts to libc overloads
Date: Fri, 30 Jan 2009 20:38:00 -0000	[thread overview]
Message-ID: <20090130203838.13716.qmail@sourceware.org> (raw)
In-Reply-To: <bug-30928-6008@http.gcc.gnu.org/bugzilla/>



------- Comment #3 from marc dot glisse at normalesup dot org  2009-01-30 20:38 -------
Hello,

looking at the two last comments, I think we are speaking of slightly different
things, although they are related. I was asking for some const_cast of the
return value, in case the const version of wcschr (or other) we are forwarding
to (from the non-const overload) has the official C++ prototype. In any case,
it can't hurt and makes the code a bit cleaner with respect to the intended
behaviour. I was then planning to ask glibc to insert a macro in the
declaration:
extern MYMACRO void* memchr(const void*,int,size_t); where MYMACRO could be
defined as "const" by a C++ implementation, but apparently an even better fix
was adopted, cool :-)

The fix mentionned by Jakub is the right way to do things for a well-behaved
libc (solaris with __cplusplus>=199711L, or apparently a very recent glibc).
Hopefully the same thing will be done for the other headers (cstdlib or cmath
for instance), although the interaction with C99/C++0X may require 2 macros
instead of just one.

Bug 33935 asks that g++ ship a string.h that is equivalent to cstring when
__CORRECT_ISO_CPP_STRING_H_PROTO is not defined. Obviously it is not that easy
because standard headers including each other may end up including the
wrappers, but now that glibc and its multiply included headers are out of the
way it may be easier (or not). Too bad there is no easy way to distinguish libc
headers from other headers.

Anyway, I want to thank you both because you did not consider these issues
negligible. I'd love to help, I know how to fix most of the bugs I have filed
related to solaris headers, but I still haven't managed to get the legal
paperwork done (keep changing employers, and the FSF disclaimer is not a paper
they have ever signed before).


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30928


  parent reply	other threads:[~2009-01-30 20:38 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-02-22 18:20 [Bug libstdc++/30928] New: " marc dot glisse at normalesup dot org
2009-01-30 11:48 ` [Bug libstdc++/30928] " jakub at gcc dot gnu dot org
2009-01-30 12:07 ` paolo dot carlini at oracle dot com
2009-01-30 12:09 ` paolo dot carlini at oracle dot com
2009-01-30 20:38 ` marc dot glisse at normalesup dot org [this message]
2010-01-14 17:24 ` paolo dot carlini at oracle dot com
2010-01-14 20:35 ` marc dot glisse at normalesup dot org
2010-01-14 20:44 ` paolo dot carlini at oracle dot com

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090130203838.13716.qmail@sourceware.org \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).