Project

General

Profile

Actions

Feature #12271

closed

"name" member of "struct option" should be const

Added by Joshua M. Clulow almost 4 years ago. Updated almost 4 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
lib - userland libraries
Start date:
Due date:
% Done:

100%

Estimated time:
Difficulty:
Bite-size
Tags:
Gerrit CR:
External Bug:

Description

In getopt.h we define struct option, which has a char *name member. On other platforms (e.g., modern Linux distributions, Mac OS X), this is actually const char *name. We should make our definition const as well, for better compatibility.

Actions #1

Updated by Jonathan Perkin almost 4 years ago

I tested this in a bulk build.

Baseline: https://us-east.manta.joyent.com/pkgsrc/public/reports/upstream-bulktest/20200207.1853/meta/report.html
Patched: https://us-east.manta.joyent.com/pkgsrc/public/reports/upstream-bulktest/20200208.2201/meta/report.html

Executive summary is no regressions caused by the change, but it did fix one build (devel/kyua).

Actions #2

Updated by Andy Fiddaman almost 4 years ago

hadfl has done a full OmniOS build with this fix in place, including all of the extra packages. No regressions.

Actions #3

Updated by Joshua M. Clulow almost 4 years ago

  • Assignee set to Brian Bennett
Actions #4

Updated by Michal Nowak almost 4 years ago

I'll see if I can rebuild OpenIndiana-specific components.

Actions #5

Updated by Michal Nowak almost 4 years ago

Michal Nowak wrote:

I'll see if I can rebuild OpenIndiana-specific components.

I rebuilt a bunch of OI-specific components without a problem.

Actions #6

Updated by Brian Bennett almost 4 years ago

In addition to testing provided by Joyent, OmniOS, and OpenIndiana, I built/installed/booted this build, where I discovered several utilities that also needed to be updated (also included in this patch).

Actions #7

Updated by Electric Monk almost 4 years ago

  • Status changed from New to Closed
  • % Done changed from 0 to 100

git commit b69c34dad3717624ff6b4f32b71014ee05b6a678

commit  b69c34dad3717624ff6b4f32b71014ee05b6a678
Author: Brian Bennett <brian.bennett@joyent.com>
Date:   2020-03-04T00:23:38.000Z

    12271 "name" member of "struct option" should be const
    Reviewed by: Toomas Soome <tsoome@me.com>
    Reviewed by: C Fraire <cfraire@me.com>
    Reviewed by: Robert Mustacchi <rm+illumos@fingolfin.org>
    Approved by: Dan McDonald <danmcd@joyent.com>

Actions

Also available in: Atom PDF