This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ 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: verbose terminate() on by default, pass 2


Gabriel Dos Reis wrote:
> Ulrich Drepper <drepper@redhat.com> writes:
> 
> |    char* p = "flop";
> | 
> | is wrong since the derefence does *not* belong to the type but instead
> | the variable
> 
> The variable "p" has type "char*".  The vairbake "p" is not being
> derefereced here.  The variable "p" is being initialized with a value
> of type "char*".  

... and

  char *p;

says just that.  This silly attempt to keep all the parts of the type
syntactically together fails in so many cases that I really cannot
understand how somebody, who claims to have thought about these issues,
can try to argue for it.  What about

  int (*f) (int) = 0;

or even

  int (*f) (int) = 0, b = 0;

Where is your emphasis on type here?  You just say that C++ people use a
different style but as everybody else you cannot give sufficient
justification.  Instead you're hiding behind existing practice which
somebody, who didn't understand all the consequences, came up with.
This is no argument you can use to force somebody to not use a more
consistent and clearer scheme.

I know that this rant won't change anything since unfortunately the
wrong people have influence in the decision.  But do not claim that this
scheme is universally recognized as correct and better, and that C
people immediately start using it once they "see the light of C++".
It's completely wrong since nobody who truly understands the syntax can
agree.  Your scheme only makes since in a language with different
syntax.  Function pointer definitions have to be written as

  int(*)(int) f;

and multiple definitions are not allowed.  But this is not C++.  So save
your indoctrination for the time when you have created this new language.

-- 
--------------.                        ,-.            444 Castro Street
Ulrich Drepper \    ,-----------------'   \ Mountain View, CA 94041 USA
Red Hat         `--' drepper at redhat.com `---------------------------


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