Bug 4875

Summary: the typedef in X11/Intrinsic.h for Arg does not qualify the name field with const
Product: xorg Reporter: Andrew J. Schorr <aschorr>
Component: Lib/XtAssignee: Jeremy Huddleston Sequoia <jeremyhu>
Status: RESOLVED MOVED QA Contact: Xorg Project Team <xorg-team>
Severity: minor    
Priority: high    
Version: unspecified   
Hardware: All   
OS: All   
Whiteboard: 2011BRB_Reviewed
i915 platform: i915 features:

Description Andrew J. Schorr 2005-10-25 07:17:07 UTC
In X11/Intrinsic.h, we have this:

typedef char *String;

typedef struct {
    String      name;
    XtArgVal    value;
} Arg, *ArgList;

As a result, when the XtSetArg macro is used to populate one
of these structures, it is often the case that a constant string
(e.g. 'const char *') is assigned to the name field.  Since name
does not have the const qualifier, a compiler warning is issued.

Is there any reason not to use 'const char *' for the name field?
I cannot see why any code would have a reason to modify the name
string...
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:41 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/2.

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.