From: Joseph Myers <joseph@codesourcery.com>
To: Martin Uecker <uecker@tugraz.at>
Cc: <gcc-patches@gcc.gnu.org>
Subject: Re: [C PATCH 1/6] c: reorganize recursive type checking
Date: Wed, 6 Sep 2023 20:59:55 +0000 [thread overview]
Message-ID: <af2c27af-7257-4152-8977-8b4027894fb@codesourcery.com> (raw)
In-Reply-To: <1df29de95ff41a02ffd218f4cd69f8f93df35321.camel@tugraz.at>
On Sat, 26 Aug 2023, Martin Uecker via Gcc-patches wrote:
> -static int
> +static bool
> comp_target_types (location_t location, tree ttl, tree ttr)
The comment above this function should be updated to refer to returning
true, not to returning 1. And other comments on common_pointer_type and
inside that function should be updated to refer to comp_target_types
returning true, not nonzero.
> @@ -1395,17 +1382,13 @@ free_all_tagged_tu_seen_up_to (const struct tagged_tu_seen_cache *tu_til)
>
> /* Return 1 if two 'struct', 'union', or 'enum' types T1 and T2 are
> compatible. If the two types are not the same (which has been
> - checked earlier), this can only happen when multiple translation
> - units are being compiled. See C99 6.2.7 paragraph 1 for the exact
> - rules. ENUM_AND_INT_P and DIFFERENT_TYPES_P are as in
> - comptypes_internal. */
> + checked earlier). */
>
> -static int
> +static bool
> tagged_types_tu_compatible_p (const_tree t1, const_tree t2,
> - bool *enum_and_int_p, bool *different_types_p)
> + struct comptypes_data* data)
Similarly, this comment should be updated for the new return type. Also
the GNU style is "struct comptypes_data *data" with space before not after
'*'.
> @@ -1631,9 +1603,9 @@ tagged_types_tu_compatible_p (const_tree t1, const_tree t2,
> Otherwise, the argument types must match.
> ENUM_AND_INT_P and DIFFERENT_TYPES_P are as in comptypes_internal. */
>
> -static int
> +static bool
> function_types_compatible_p (const_tree f1, const_tree f2,
> - bool *enum_and_int_p, bool *different_types_p)
> + struct comptypes_data *data)
Another comment to update for a changed return type.
> /* Check two lists of types for compatibility, returning 0 for
> - incompatible, 1 for compatible, or 2 for compatible with
> - warning. ENUM_AND_INT_P and DIFFERENT_TYPES_P are as in
> - comptypes_internal. */
> + incompatible, 1 for compatible. ENUM_AND_INT_P and
> + DIFFERENT_TYPES_P are as in comptypes_internal. */
>
> -static int
> +static bool
> type_lists_compatible_p (const_tree args1, const_tree args2,
> - bool *enum_and_int_p, bool *different_types_p)
> + struct comptypes_data *data)
This one also needs updating to remove references to parameters that no
longer exist.
--
Joseph S. Myers
joseph@codesourcery.com
next prev parent reply other threads:[~2023-09-06 21:00 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-26 16:19 c23 type compatibility rules, v2 Martin Uecker
2023-08-26 16:20 ` [C PATCH 1/6] c: reorganize recursive type checking Martin Uecker
2023-09-06 20:59 ` Joseph Myers [this message]
2023-09-10 8:17 ` [C PATCH 1/6 v2] " Martin Uecker
2023-09-11 20:28 ` Joseph Myers
2023-08-26 16:22 ` [C PATCH 2/6] c23: recursive type checking of tagged type Martin Uecker
2023-11-07 23:06 ` Joseph Myers
2023-08-26 16:23 ` [C PATCH 3/6] c23: tag compatibility rules for struct and unions Martin Uecker
2023-11-07 23:18 ` Joseph Myers
2023-08-26 16:24 ` [C PATCH 4/6] c23: tag compatibility rules for enums Martin Uecker
2023-11-07 23:20 ` Joseph Myers
2023-08-26 16:25 ` [C PATCH 5/6] c23: aliasing of compatible tagged types Martin Uecker
2023-08-26 16:26 ` [C PATCH 6/6] c23: construct composite type for " Martin Uecker
2023-11-07 23:45 ` Joseph Myers
2023-08-26 16:26 ` [C PATCH] c: flag for tag compatibility rules Martin Uecker
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=af2c27af-7257-4152-8977-8b4027894fb@codesourcery.com \
--to=joseph@codesourcery.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=uecker@tugraz.at \
/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).