public inbox for fortran@gcc.gnu.org
 help / color / mirror / Atom feed
From: Janne Blomqvist <blomqvist.janne@gmail.com>
To: Steve Kargl <sgk@troutmask.apl.washington.edu>
Cc: Fortran List <fortran@gcc.gnu.org>,
	GCC Patches <gcc-patches@gcc.gnu.org>
Subject: Re: [PATCH] Fortran -- clean up KILL
Date: Tue, 13 Mar 2018 19:49:00 -0000	[thread overview]
Message-ID: <CAO9iq9EtnxK1vegKw_ec6Ybr9gjpz17LSnF0GSQ1DQJoMpYdcQ@mail.gmail.com> (raw)
In-Reply-To: <20180313040809.GA69151@troutmask.apl.washington.edu>

On Tue, Mar 13, 2018 at 6:08 AM, Steve Kargl
<sgk@troutmask.apl.washington.edu> wrote:
> On Mon, Mar 12, 2018 at 09:05:09PM +0200, Janne Blomqvist wrote:
>>
>> Yes, I understand that -fdefault-integer-8 (or whatever the equivalent
>> option was called on g77) is the original motivation. Like I said, I
>> don't have any particular opinion on whether we should keep that
>> restriction or not. On one hand, more recent versions of the standard
>> has lifted restrictions that integer intrinsic arguments have to be of
>> default kind in many cases, OTOH KILL is not a standard intrinsic but
>> something inherited from g77. So, meh.
>
> The Fortran standard specifically permits a Fortran processor to
> supply additional subprograms not contained in the Fortran standard.
> I personally can't any person person using INTEGER(1) or even
> INTEGER(2) with KILL as pid_t on typical modern OS's exceeds HUGE()
> in those types.  My original patch simply fixed KILL to actually
> conform to its documentation.  But is this what you want

Yes, very much so! Thanks!

One little nit, I think in libgfortran/intrinsics/kill.c

+kill (GFC_INTEGER_4 pid, GFC_INTEGER_4 signal)
 {
-  GFC_INTEGER_4 val;
-  kill_i4_sub (pid, signal, &val);
-  return val;
+  return (int)kill (pid, signal);
 }

the implementation should be something like

int val = kill (pid, signal);
return (val == 0): 0 ? errno;

like it already does for the optional status argument for kill_sub.

-- 
Janne Blomqvist

  reply	other threads:[~2018-03-13 19:49 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-11 16:52 Steve Kargl
2018-03-11 20:16 ` Janne Blomqvist
2018-03-11 20:42   ` Steve Kargl
2018-03-12 16:56     ` Janne Blomqvist
2018-03-12 17:37       ` Steve Kargl
2018-03-12 19:05         ` Janne Blomqvist
2018-03-13  4:08           ` Steve Kargl
2018-03-13 19:49             ` Janne Blomqvist [this message]
2018-03-14  0:57               ` Steve Kargl
2018-03-15 10:18                 ` Bin.Cheng
2018-03-15 12:11                   ` Bin.Cheng
2018-03-15 12:20                     ` Bin.Cheng
2018-03-15 15:07                       ` Steve Kargl
2018-03-15 12:35                     ` Richard Biener
2018-03-15 14:10                       ` Steve Kargl
2018-03-15 16:35                         ` Jakub Jelinek
2018-03-15 15:45                           ` Bin.Cheng
2018-03-15 17:35                             ` Jakub Jelinek
2018-03-15 15:57                               ` Bin.Cheng
2018-03-15 16:28                           ` Steve Kargl

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=CAO9iq9EtnxK1vegKw_ec6Ybr9gjpz17LSnF0GSQ1DQJoMpYdcQ@mail.gmail.com \
    --to=blomqvist.janne@gmail.com \
    --cc=fortran@gcc.gnu.org \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=sgk@troutmask.apl.washington.edu \
    /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).