This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos 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: linking problem when using "fopen"


On Fri, 2002-04-05 at 18:48, Jonathan Larmour wrote:

[...]

> > In this particular case, (new not overridden and no C++ exceptions), I
> > believe that a safe way to do it would first allocate the required space
> > using "new char [sizeof(...)]", and then if this doesn't return 0 then
> > call the placement operator new to actually create the object.
> 
> char's probably bad in case there are alignment issues (future/alternative
> versions of malloc may not align things so generously (i.e. wastefully).
> 

I do not agree, the new expression must return an address correctly
aligned according to ISO/IEC 14882:1998(E) 5.3.4 §10. But that's a
detail and your solution will perfectly do the job.

[...]

Robin



--
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss


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