LKML Archive on
help / color / mirror / Atom feed
From: Nicolas Iooss <>
To:, Jeff Mahoney <>
Cc: "" <>
Subject: reiserfs: inconsistent format in __RASSERT
Date: Mon, 16 Mar 2015 20:55:55 +0800	[thread overview]
Message-ID: <> (raw)


When adding a __printf attribute to reiserfs_panic, gcc reported an
inconsistent format for __RASSERT.  This macro is currently defined in
fs/reiserfs/reiserfs.h as:

    reiserfs_panic(NULL, "assertion failure", "(" #cond ") at " \
        __FILE__ ":%i:%s: " format "\n",                        \
        in_interrupt() ? -1 : task_pid_nr(current),             \
        __LINE__, __func__ , ##args);

In the format string, the first parameter is a line number, but in the
arguments there is a PID before.  Before c3a9c2109f84 ("reiserfs: rework
reiserfs_panic") [1], the format string began with "reiserfs[%i]" [2],
which explains the PID in the arguments.

I see three possibilities:

* I missed something in my analysis and in fact the PID argument is
processed by reiserfs_panic (don't know where), or
* the PID argument is not used and should be removed, or
* the PID is useful and "[%i]" should be added somewhere in the format

Which one would you prefer?

Also, I found this when building the kernel with "allmodconfig" on
x86_64.  With "defconfig" gcc does not report this error, but I guess it
is because without CONFIG_REISERFS_CHECK, __RASSERT is never used.




             reply	other threads:[~2015-03-16 12:56 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-16 12:55 Nicolas Iooss [this message]
2015-03-16 13:05 ` Jeff Mahoney
2015-03-16 13:18   ` Nicolas Iooss
2015-03-16 13:45     ` [PATCH] reiserfs: fix __RASSERT format string Nicolas Iooss
2015-03-17 14:26       ` Jeff Mahoney
2015-03-17 15:22         ` Jan Kara

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:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \ \
    --subject='Re: reiserfs: inconsistent format in __RASSERT' \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

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).