Issue 102742 - sw: gcc44 warnings, returning a pointer that is itself const is meaningless
Summary: sw: gcc44 warnings, returning a pointer that is itself const is meaningless
Status: CLOSED FIXED
Alias: None
Product: Writer
Classification: Application
Component: code (show other issues)
Version: DEV300m50
Hardware: All Linux, all
: P3 Trivial (vote)
Target Milestone: ---
Assignee: dtardon
QA Contact: issues@sw
URL:
Keywords:
Depends on:
Blocks: 96084
  Show dependency tree
 
Reported: 2009-06-13 16:40 UTC by caolanm
Modified: 2013-08-07 14:44 UTC (History)
1 user (show)

See Also:
Issue Type: PATCH
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments
simple patch (607 bytes, patch)
2009-06-13 16:41 UTC, caolanm
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this issue.
Description caolanm 2009-06-13 16:40:42 UTC
i.e.

static ::sw::mark::DdeBookmark* const lcl_FindDdeBookmark(...)

On primitive types making something return a X* const is meaningless, you cannot
enforce that the variable it is assigned to will not be allowed take another
value, i.e.

::sw::mark::DdeBookmark* foo = lcl_FindDdeBookmark()

is still perfectly possible.

const ::sw::mark::DdeBookmark* lcl_FindDdeBookmark() is a totally different
thing to ensure that the memory pointed to by foo cannot be modified and in
general is what was intended, which is why the warning exists. In this case
though, that's not possible. So just the simple attached patch is needed to
silence the warning
Comment 1 caolanm 2009-06-13 16:41:01 UTC
Created attachment 62968 [details]
simple patch
Comment 2 caolanm 2009-06-13 16:41:26 UTC
.
Comment 3 caolanm 2009-06-13 16:42:31 UTC
done in cmcfixes60
Comment 4 caolanm 2009-07-01 16:44:04 UTC
cmc->dtardon: can you verify this in cmcfixes60 ?
Comment 5 dtardon 2009-07-03 05:23:13 UTC
builds without warning in cmcfixes60
Comment 6 dtardon 2009-08-06 12:45:33 UTC
seen in DEV300_m54