taskThe GNU Hurd - Tasks: task #6615, Mig should output const in...


task #6615: Mig should output const in generated prototypes

Submitter:  Samuel Thibault <sthibaul>
Submitted:  Sat 10 Mar 2007 10:54:09 PM UTC
Category:  GNU MIG Should Start On:  Fri 09 Mar 2007 11:00:00 PM UTC
Should be Finished on:  Fri 09 Mar 2007 11:00:00 PM UTC Priority:  * 1 - Later
Status:  In Progress Privacy:  Public
Percent Complete:  90% Assigned to:  tschwinge
Open/Closed:  Open Planned Release:  None
Effort:  0.00
Wiki-like text discussion box: 
* Mandatory Fields

Add a New Comment (Rich Markup)

Comment Type & Canned Response:
       No canned response available


Tue 15 Feb 2022 09:39:42 PM UTC, comment #2: 

I have actually implemented it a few weeks ago. There is still an issue with it: in libdiskfs/file-exec.c and libnetfs/file-exec.c,  ‘fshelp_exec_reauth’ is called with a const parameter.

Samuel Thibault <sthibaul>
Project Administrator
Tue 29 Jul 2008 09:45:33 AM UTC, comment #1: 

One thing is to have the MIG-generated user stubs use `const' where appropriate for IN parameters.  Another thing is to have the server routines (Hurd servers, etc.) use `const' where appropriate for IN parameters and have the MIG-generated server stubs adhere to that.  I'm testing patches for both of these and also already (locally, not yet pushed) did changes to the Hurd (quite a few, obviously, but trivial) and glibc (not many) source code to make them compile again.  Lacking a proper system at the moment, I have not yet tried to run the resulting binaries.

Thomas Schwinge <tschwinge>
Project Administrator
Sat 10 Mar 2007 10:54:09 PM UTC, original submission:  

For instance, GNU Mach's include/device/device.defs declares

routine device_write(
                device          : device_t;
        sreplyport reply_port   : reply_port_t;
        in      mode            : dev_mode_t;
        in      recnum          : recnum_t;
        in      data            : io_buf_ptr_t;
        out     bytes_written   : int

which results to the following device_write prototype:

kern_return_t device_write
        mach_port_t device,
        dev_mode_t mode,
        recnum_t recnum,
        io_buf_ptr_t data,
        mach_msg_type_number_t dataCnt,
        int *bytes_written

memory pointed to by data is provided by the client and not modified by the server, so in this case "const" should be output just before io_buf_ptr_t.

That fix makes a lot of sense and would drop a bunch of spurious warnings in the glibc compilation log.

Samuel Thibault <sthibaul>
Project Administrator


(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:

No files currently attached


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by tschwinge (Posted a comment)
  • -email is unavailable- added by sthibaul (Submitted the item)

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.





    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2022-02-15 sthibaul Percent Complete0% 90%
    2008-07-29 tschwinge StatusNone In Progress
        Assigned toNone tschwinge

    Back to the top

    Powered by Savane 3.9