[lug] objdump, nm, and const

Zan Lynx zlynx at acm.org
Tue Jun 17 17:22:49 MDT 2003


On Tue, 2003-06-17 at 15:16, D. Stimits wrote:
[snip]
> Is it possible with objdump or nm 
> to verify the argument as being marked const or not being marked const? 
> It is my belief that g++ is correct, and that the lib is not compiled 
> with const in the function char* argument.

As far as I know, const is only enforced by the compiler.  You are
allowed to cast const away and write to the variable if you really want
to, so the linker does not put const variables into read-only sections.

I think you should look into your library's header files where this
variable is defined and make sure it is const there.
-- 
Zan Lynx <zlynx at acm.org>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL: <http://lists.lug.boulder.co.us/pipermail/lug/attachments/20030617/79b852fb/attachment.pgp>


More information about the LUG mailing list