From patchwork Fri Oct 17 18:32:07 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?TWFudWVsIEzDs3Blei1JYsOhw7Fleg==?= X-Patchwork-Id: 400609 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3B7201400B8 for ; Sat, 18 Oct 2014 05:32:42 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :mime-version:from:date:message-id:subject:to:content-type; q= dns; s=default; b=YIUQt8NNDA9dteyxfa86OsNzPW9R38bAdAJOvDaQNf22/H fVufoof60VR0FiZ+H8yGpC3uNsNJykGNqv/v0KhWjS3QcfOzmGrJtO6bHCaKGbDn 21lqwrRFV9j1zfyrpoeQDrRXEZELhHigVPTQ/xR87qNZAvHwvF4YuPKZBHaTM= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :mime-version:from:date:message-id:subject:to:content-type; s= default; bh=9WKkwg9K22qPyEmDu2ssKQUgckU=; b=jbsVKteZxCZQtvzwI4rN 0QtRAJV2LcQM684Ud2xxzheIIq99vCJmPp/qONp4C9g7JqeylFz+umxWINZ/Y7fh HG9iZHX6jOgOTXBvmMgQ+VMc88wTkMAngbyjyFKqd3WpOS4S+m/aEduX+f0Ueg0h PEl3s2HH8yB3UIe8ympg/+A= Received: (qmail 31486 invoked by alias); 17 Oct 2014 18:32:32 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 31399 invoked by uid 89); 17 Oct 2014 18:32:31 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.2 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-wi0-f177.google.com Received: from mail-wi0-f177.google.com (HELO mail-wi0-f177.google.com) (209.85.212.177) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Fri, 17 Oct 2014 18:32:30 +0000 Received: by mail-wi0-f177.google.com with SMTP id fb4so1972640wid.10 for ; Fri, 17 Oct 2014 11:32:27 -0700 (PDT) X-Received: by 10.180.104.199 with SMTP id gg7mr735533wib.41.1413570747289; Fri, 17 Oct 2014 11:32:27 -0700 (PDT) MIME-Version: 1.0 Received: by 10.217.80.73 with HTTP; Fri, 17 Oct 2014 11:32:07 -0700 (PDT) From: =?ISO-8859-1?Q?Manuel_L=F3pez=2DIb=E1=F1ez?= Date: Fri, 17 Oct 2014 20:32:07 +0200 Message-ID: Subject: [PATCH doc] Explain options precedence and difference between -pedantic-errors and -Werror=pedantic To: Gcc Patch List , "Joseph S. Myers" , Gerald Pfeifer While writing the guidelines https://gcc.gnu.org/wiki/Better_Diagnostics#guidelines , I noticed that we never explain the precedence rules between conflicting options. Also, the description of -pedantic-errors could be more precise. OK? Index: invoke.texi =================================================================== --- invoke.texi (revision 215973) +++ invoke.texi (working copy) @@ -3263,6 +3263,15 @@ language-specific options also refer to @ref{C++ Dialect Options} and @ref{Objective-C and Objective-C++ Dialect Options}. +Some options, such as @option{-Wall} and @option{-Wextra}, turn on other +options, such as @option{-Wunused}, which may turn on further options, +such as @option{-Wunused-value}. The combined effect of positive and +negative forms is that more specific options have priority over less +specific ones, independently of their position in the command-line. For +options of the same specificity, the last one takes effect. Options +enabled or disabled via pragmas (@pxref{Diagnostic Pragmas}) take effect +as if they appeared at the end of the command-line. + When an unrecognized warning option is requested (e.g., @option{-Wunknown-warning}), GCC emits a diagnostic stating that the option is not recognized. However, if the @option{-Wno-} form @@ -3318,8 +3327,8 @@ @item -pedantic-errors @opindex pedantic-errors -Like @option{-Wpedantic}, except that errors are produced rather than -warnings. +This is equivalent to @option{-Werror=pedantic} plus making into errors +a few warnings that are not controlled by @option{-Wpedantic}. @item -Wall @opindex Wall