From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754751AbbCPM4E (ORCPT ); Mon, 16 Mar 2015 08:56:04 -0400 Received: from mail-pd0-f181.google.com ([209.85.192.181]:33348 "EHLO mail-pd0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754084AbbCPMz7 (ORCPT ); Mon, 16 Mar 2015 08:55:59 -0400 Message-ID: <5506D2DB.6040907@m4x.org> Date: Mon, 16 Mar 2015 20:55:55 +0800 From: Nicolas Iooss User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: reiserfs-devel@vger.kernel.org, Jeff Mahoney CC: "linux-kernel@vger.kernel.org" Subject: reiserfs: inconsistent format in __RASSERT Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello, 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 string. 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. Regards, Nicolas [1] https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=c3a9c2109f84882b9b3178f6b1838d550d3df0ec [2] https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/include/linux/reiserfs_fs.h?id=78b6513d2881f1a759fb9825a036d926392de084#n91