constant expression analyzer and 'sizeof'

Stefan Seefeld <[email protected]>
Newsgroups gmane.comp.documentation.synopsis
Message-ID <20DCDD8F0FCED411AC4D001083CF504501AA9781@MTL-EXCHANGE>
Hi there,

I'm working on a constant expression analyzer
to assist the C++ parser. It's working nicely
so far. Here is what it already can deal with:

http://synopsis.fresco.org/viewsvn/synopsis-Synopsis/trunk/tests/OpenCxx/Con
stEvaluator/

However, some cases are not as simple, and so
I'd appreciate feedback: the 'sizeof' operator
can be used in const expressions, and so I have
to deal with it. 
AFAIK each compiler has its own memory
layout, and thus there's no standard algorithm
to determine the size of an arbitrary type.

On the other hand, there is no requirement for
Synopsis / OpenC++ to be binary compatible with
any other compiler, so may be this is a non-issue.

Still, I need to provide some numbers when asked
for the size of an object. Any ideas how to approach
this ? Any references are highly appreciated !

Regards,
		Stefan
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.