public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Matthew Fortune <Matthew.Fortune@imgtec.com>
To: Steve Ellcey <Steve.Ellcey@imgtec.com>,
	"gcc-patches@gcc.gnu.org"	<gcc-patches@gcc.gnu.org>
Cc: "clm@codesourcery.com" <clm@codesourcery.com>
Subject: RE: [Patch, MIPS] Remove definition of TARGET_PROMOTE_PROTOTYPES
Date: Sat, 12 Dec 2015 08:53:00 -0000	[thread overview]
Message-ID: <6D39441BF12EF246A7ABCE6654B0235361D03859@LEMAIL01.le.imgtec.org> (raw)
In-Reply-To: <1449875085.4788.106.camel@ubuntu-sellcey>

Steve Ellcey <Steve.Ellcey@imgtec.com> writes:
> On Tue, 2015-11-10 at 15:57 -0800, Steve Ellcey wrote:
> > 2015-11-10  Steve Ellcey  <sellcey@imgtec.com>
> >
> > 	* config/mips/mips.c (mips_promote_function_mode): New function.
> > 	(TARGET_PROMOTE_FUNCTION_MODE): Define as above function.
> > 	(TARGET_PROMOTE_PROTOTYPES): Remove.

I'm OK with this change on the basis that MIPS has been providing stronger
guarantees than required by the various standards. I.e. after this change
MIPS will have undefined behaviour for a mismatch in types between a
call to an un-prototyped function and its definition:

extern void foo();

void caller(int a)
{
  foo(a);
}

--

void foo(short a)
{
  // the value of 'a' can be out of range of a short because the caller
  // did not get the right type for the argument.
}

Thanks,
Matthew

  reply	other threads:[~2015-12-12  8:53 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-10 23:58 Steve Ellcey 
2015-12-11 23:04 ` Steve Ellcey
2015-12-12  8:53   ` Matthew Fortune [this message]
2016-01-19 15:25     ` Maciej W. Rozycki

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=6D39441BF12EF246A7ABCE6654B0235361D03859@LEMAIL01.le.imgtec.org \
    --to=matthew.fortune@imgtec.com \
    --cc=Steve.Ellcey@imgtec.com \
    --cc=clm@codesourcery.com \
    --cc=gcc-patches@gcc.gnu.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).