linux-man.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Michael Kerrisk (man-pages)" <mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: Martin Gebert <Murphy.Gebert-Mmb7MZpHnFY@public.gmane.org>
Cc: mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org,
	linux-man-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: backtrace(3): Inconsistency and missing indentation
Date: Fri, 26 Feb 2016 16:46:17 +0100	[thread overview]
Message-ID: <56D07349.10901@gmail.com> (raw)
In-Reply-To: <56CD772C.8030606-Mmb7MZpHnFY@public.gmane.org>

On 02/24/2016 10:26 AM, Martin Gebert wrote:
> In the example section of the page the following snippet is given:
> 
> --8><--
>         void
>         myfunc3(void)
>         {
>             int j, nptrs;
>         #define SIZE 100
>             void *buffer[100];
>             char **strings;
> 
>             nptrs = backtrace(buffer, SIZE);
> --><8--
> 
> Problems:
> 
>  1. "#define SIZE 100" is not indented correctly.
>  2. SIZE should also be used for the buffer array size.

Thanks, Martin. Fixed as below.

Cheers,

Michael

diff --git a/man3/backtrace.3 b/man3/backtrace.3
index afca93d..064b970 100644
--- a/man3/backtrace.3
+++ b/man3/backtrace.3
@@ -215,8 +215,8 @@ void
 myfunc3(void)
 {
     int j, nptrs;
-#define SIZE 100
-    void *buffer[100];
+    const int SIZE = 100;
+    void *buffer[SIZE];
     char **strings;
 
     nptrs = backtrace(buffer, SIZE);



-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2016-02-26 15:46 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-24  9:26 backtrace(3): Inconsistency and missing indentation Martin Gebert
     [not found] ` <56CD772C.8030606-Mmb7MZpHnFY@public.gmane.org>
2016-02-26 15:46   ` Michael Kerrisk (man-pages) [this message]
     [not found]     ` <56D07349.10901-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2016-02-26 19:52       ` Keith Thompson
     [not found]         ` <CAAHpriNbkVCsH-mrVi97Y57ahw=6yO=kh+C7OuLzfQXrJiJO-Q-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-02-26 20:35           ` Michael Kerrisk (man-pages)
     [not found]             ` <56D0B704.8050001-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2016-02-26 20:41               ` Keith Thompson
2016-02-26 21:08               ` Martin Gebert
     [not found]                 ` <56D0BEBD.50908-Mmb7MZpHnFY@public.gmane.org>
2016-02-28 19:21                   ` Michael Kerrisk (man-pages)

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=56D07349.10901@gmail.com \
    --to=mtk.manpages-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
    --cc=Murphy.Gebert-Mmb7MZpHnFY@public.gmane.org \
    --cc=linux-man-u79uwXL29TY76Z2rM5mHXA@public.gmane.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 NNTP newsgroup(s).