Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c > #107059

Re: Can a variable be both static and extern

Path csiph.com!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From Ike Naar <ike@iceland.freeshell.org>
Newsgroups comp.lang.c
Subject Re: Can a variable be both static and extern
Date Sat, 25 Mar 2017 19:50:59 -0000 (UTC)
Organization A noiseless patient Spider
Lines 16
Message-ID <slrn3vfsoddim0.aa0.ike@iceland.freeshell.org> (permalink)
References <6e7c0a5e-70aa-4163-b29a-3625ffc541d0@googlegroups.com> <58d50784.12570828@news.xs4all.nl> <ob3gad$var$1@dont-email.me> <ob3gvq$1mg$1@dont-email.me> <ob3i26$5fo$2@dont-email.me> <ob3o2p$rak$1@dont-email.me> <b0a05f7d-ba76-3ffd-7b45-0f53b9fd766b@verizon.net> <ob66rd$phv$1@dont-email.me> <lna8898dq3.fsf@kst-u.example.com> <ob6cec$c47$2@dont-email.me> <bdda383e-0747-4e9e-ba8f-0eee5342cf3c@googlegroups.com>
Mime-Version 1.0
Content-Type text/plain; charset=us-ascii
Content-Transfer-Encoding 7bit
Injection-Date Sat, 25 Mar 2017 19:50:59 -0000 (UTC)
Injection-Info mx02.eternal-september.org; posting-host="8dd3fbaf14ff885ba980a302b671f943"; logging-data="5816"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+l7xNg2N/KygaI53nhJiCi"
User-Agent slrn/0.9.9p1 (NetBSD)
Cancel-Lock sha1:vTZgoxVs9K6BnXA9PwNWlF91WXY=
Xref csiph.com comp.lang.c:107059

Show key headers only | View raw


On 2017-03-25, supercat@casperkitty.com <supercat@casperkitty.com> wrote:
>      type2 someFunction(type1 *p1, type2 *p2, type1 v)
>      {
>        *p1 = v;
>        return *p1;
>      }

It looks like what you wrote is not what you intended to write.
What is the purpose of the unused parameter p2?

>      ... and then in some other function
>
>      return someFunction(&someUnion.m1, &someUnion.m2);

Here a function that has three parameters is called with only two arguments.
Something must have gone wrong. Can you post an improved version?

Back to comp.lang.c | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Can a variable be both static and extern acidlategamer@gmail.com - 2017-03-24 04:23 -0700
  Re: Can a variable be both static and extern Richard Heathfield <rjh@cpax.org.uk> - 2017-03-24 11:40 +0000
    Re: Can a variable be both static and extern acidlategamer@gmail.com - 2017-03-24 04:54 -0700
      Re: Can a variable be both static and extern Richard Heathfield <rjh@cpax.org.uk> - 2017-03-24 12:09 +0000
        Re: Can a variable be both static and extern James Kuyper <jameskuyper@verizon.net> - 2017-03-24 11:45 -0400
          Re: Can a variable be both static and extern raltbos@xs4all.nl (Richard Bos) - 2017-03-25 22:27 +0000
    Re: Can a variable be both static and extern Keith Thompson <kst-u@mib.org> - 2017-03-24 11:35 -0700
  Re: Can a variable be both static and extern Ben Bacarisse <ben.usenet@bsb.me.uk> - 2017-03-24 12:11 +0000
  Re: Can a variable be both static and extern raltbos@xs4all.nl (Richard Bos) - 2017-03-24 12:14 +0000
    Re: Can a variable be both static and extern David Brown <david.brown@hesbynett.no> - 2017-03-24 17:11 +0100
      Re: Can a variable be both static and extern scott@slp53.sl.home (Scott Lurndal) - 2017-03-24 16:22 +0000
        Re: Can a variable be both static and extern David Brown <david.brown@hesbynett.no> - 2017-03-24 17:38 +0100
      Re: Can a variable be both static and extern James Kuyper <jameskuyper@verizon.net> - 2017-03-24 12:23 -0400
        Re: Can a variable be both static and extern David Brown <david.brown@hesbynett.no> - 2017-03-24 17:41 +0100
          Re: Can a variable be both static and extern jameskuyper@verizon.net - 2017-03-24 09:57 -0700
          Re: Can a variable be both static and extern supercat@casperkitty.com - 2017-03-24 10:38 -0700
          Re: Can a variable be both static and extern Richard Heathfield <rjh@cpax.org.uk> - 2017-03-24 18:24 +0000
            Re: Can a variable be both static and extern "James R. Kuyper" <jameskuyper@verizon.net> - 2017-03-25 10:47 -0400
              Re: Can a variable be both static and extern Richard Heathfield <rjh@cpax.org.uk> - 2017-03-25 16:48 +0000
                Re: Can a variable be both static and extern Keith Thompson <kst-u@mib.org> - 2017-03-25 10:31 -0700
                Re: Can a variable be both static and extern Richard Heathfield <rjh@cpax.org.uk> - 2017-03-25 18:23 +0000
                Re: Can a variable be both static and extern supercat@casperkitty.com - 2017-03-25 12:28 -0700
                Re: Can a variable be both static and extern Ike Naar <ike@iceland.freeshell.org> - 2017-03-25 19:50 +0000
                Re: Can a variable be both static and extern supercat@casperkitty.com - 2017-03-25 13:20 -0700
                Re: Can a variable be both static and extern jameskuyper@verizon.net - 2017-03-25 10:44 -0700
                Re: Can a variable be both static and extern supercat@casperkitty.com - 2017-03-25 12:13 -0700

csiph-web