Bug 4874 - string constants in X11/StringDefs.h discard const qualifier
Summary: string constants in X11/StringDefs.h discard const qualifier
Status: RESOLVED MOVED
Alias: None
Product: xorg
Classification: Unclassified
Component: Lib/Xt (show other bugs)
Version: unspecified
Hardware: All All
: high minor
Assignee: Xorg Project Team
QA Contact: Xorg Project Team
URL:
Whiteboard: 2011BRB_Reviewed
Keywords: love
Depends on:
Blocks:
 
Reported: 2005-10-25 06:58 UTC by Andrew J. Schorr
Modified: 2018-08-10 20:01 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

Description Andrew J. Schorr 2005-10-25 06:58:31 UTC
In <X11/StringDefs.h>, we have the following:

#define _XtStringDefs_h_Const const

extern _XtStringDefs_h_Const char XtStrings[];

#define XtNaccelerators ((char*)&XtStrings[0])
...

So the cast in the define is discarding the const qualifier, and gcc
complains whenever one of these defines is used:

warning: cast discards qualifiers from pointer target type

Why is the cast there at all?  Why not simply have:

#define XtNaccelerators (&XtStrings[0])

I guess this would be a simple patch to the makestrs program.  The current
behavior seems to be hard-wired into the IntelABIWriteHeader()
and DefaultWriteHeader() functions...

Regards,
Andy
Comment 1 Daniel Stone 2007-02-27 01:28:32 UTC
Sorry about the phenomenal bug spam, guys.  Adding xorg-team@ to the QA contact so bugs don't get lost in future.
Comment 2 GitLab Migration User 2018-08-10 20:01:39 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/xorg/lib/libxt/issues/1.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.