This is the mail archive of the mailing list for the Cygwin 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: objdump : inaccurate demangling for foo(char* const)

> From: []On Behalf
> Of Ronald Landheer-Cieslak

> AFAIK, const is a compiler directive - there is nothing in the assembler
> that make a symbol const. You should see const more like a promise: "I
> promise I won't change the value of this variable". That promise can be
> broken by a const-cast,

 K&R, 2nd edition, p211 last paragraph, last sentence: "Except that it
should diagnose explicit attempts to change const objects, a compiler may
ignore these qualifiers."

> and the assembler code doesn't know anything about
> it (AFAIK, there is no const in assembler, but I might be mistaken there).

 This is very true, at least for the M68K assemblers that I know of. Nor
have I seen such a thing in x86 assemblers (less knowledge).
But: SECTION's (a program data/code "hunk" - in Amiga terms) can be set to
readonly - which _may_ be enforced depending on set assembler options (i.e.
to generate stuff for ROM).

/Hannu E K Nevalainen, B.Sc. EE -and- long standing M68K <'020 assembler
-- UTC+01, DST -> UTC+02  --

Unsubscribe info:
Problem reports:

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