public inbox for libabigail@sourceware.org
 help / color / mirror / Atom feed
From: "gprocida at google dot com" <sourceware-bugzilla@sourceware.org>
To: libabigail@sourceware.org
Subject: [Bug default/30048] incorrect qualifiers within compound types
Date: Fri, 27 Jan 2023 10:05:23 +0000	[thread overview]
Message-ID: <bug-30048-9487-npUgEfwyTG@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-30048-9487@http.sourceware.org/bugzilla/>

https://sourceware.org/bugzilla/show_bug.cgi?id=30048

--- Comment #3 from gprocida at google dot com ---
Function prototypes that only differ in restrict are compatible according to
the standard.

This means that foo.c containing a declaration of f with restrict and foo.h
containing one without restrict is legal.

The type exposed to users may or may not contain restrict ("not", in the case
above). Tooling such as abidw could warn about this.

However, the C language itself makes it clear that qualifiers on function
parameter types only have an effect on the implementation, not the interface.

I'm in the camp that we should just discard them all. I don't think patches for
Linux that try to drop or add const in various places where this discrepancy
already exists would be well received by kernel maintainers.

Dropping them means dropping restrict almost everywhere. I suppose restrict
could appear in standalone function types... but that is even less useful.

For the STG tool, I'm in fact proposing dropping qualifiers on function
parameter types and return types and dropping restrict unconditionally.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

  parent reply	other threads:[~2023-01-27 10:05 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-25  9:40 [Bug default/30048] New: " gprocida at google dot com
2023-01-25  9:57 ` [Bug default/30048] " gprocida at google dot com
2023-01-27  1:10 ` woodard at redhat dot com
2023-01-27 10:05 ` gprocida at google dot com [this message]
2023-01-27 10:10 ` gprocida at google dot com
2023-02-03  0:11 ` dodji at redhat dot com
2023-02-07 17:37 ` dodji at redhat dot com
2023-02-08 13:08 ` gprocida at google dot com
2023-02-10 12:50   ` Dodji Seketeli
2023-02-10 12:50 ` dodji at seketeli dot org
2023-02-10 12:50 ` dodji at redhat dot com

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-30048-9487-npUgEfwyTG@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=libabigail@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).