9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] Anonymous function formal parameter
@ 2014-10-10 12:08 Carsten Kunze
  2014-10-10 12:43 ` [9fans] [Solved] " Carsten Kunze
  0 siblings, 1 reply; 3+ messages in thread
From: Carsten Kunze @ 2014-10-10 12:08 UTC (permalink / raw)
  To: 9fans

Hello,

in sys/src/cmd/eqn/text.c a function definition starts with

int
trans(int c, char *)
{

What does that mean (i.e. how is the second function parameter referenced?

   Carsten



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [9fans] [Solved] Anonymous function formal parameter
  2014-10-10 12:08 [9fans] Anonymous function formal parameter Carsten Kunze
@ 2014-10-10 12:43 ` Carsten Kunze
  2014-10-10 15:37   ` Brian L. Stuart
  0 siblings, 1 reply; 3+ messages in thread
From: Carsten Kunze @ 2014-10-10 12:43 UTC (permalink / raw)
  To: 9fans

> int
> trans(int c, char *)
> {

That parameter seems not to be used inside. That may answer the question...

  Carsten



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [9fans] [Solved] Anonymous function formal parameter
  2014-10-10 12:43 ` [9fans] [Solved] " Carsten Kunze
@ 2014-10-10 15:37   ` Brian L. Stuart
  0 siblings, 0 replies; 3+ messages in thread
From: Brian L. Stuart @ 2014-10-10 15:37 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

> int
> trans(int c, char *)
> {
>
> That parameter seems not to be used inside. That may answer
> the question...

Yes, that is the answer.  By alowing a parameter name to be
omitted, the compiler can warn you about unused parameters
without having to add clutter that explicitly says, "I'm ignoring
this parameter."

BLS




^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-10-10 15:37 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-10-10 12:08 [9fans] Anonymous function formal parameter Carsten Kunze
2014-10-10 12:43 ` [9fans] [Solved] " Carsten Kunze
2014-10-10 15:37   ` Brian L. Stuart

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 NNTP newsgroup(s).