This is the mail archive of the gcc@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: Compiling GCC With a C++ Compiler (g++)



On 14/10/2004, at 5:42 AM, Gabriel Dos Reis wrote:


"Dave Korn" <dk@artimi.com> writes:

|  Does this still make sense?  It's making my mind
| boggle in several directions at once.

I think there is a hole in the argument about allocating object
with malloc().  The key is to understand what the effective type of
the object is.

Why do you think the effective type has anything to do with it? Section 6.7.3 speaks only of "an object defined with a const-qualified type". For that to be relevant, you must be able to point at a definition. The word "definition" is defined in section 6.7 paragraph 5:


A definition of an identifier is a declaration for that identifier that: —for an object, causes storage to be reserved for that object ...

When malloc is used no identifier is declared, so no object allocated with malloc is ever 'defined'. This is why things allocated with malloc do not have a scope, and do not go away at the next close-brace.


This is why it's important to realise that the effective type is not relevant here. Objects allocated with malloc have an effective type, but they are not defined with a type.

Attachment: smime.p7s
Description: S/MIME cryptographic signature


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