From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 53242 invoked by alias); 24 Apr 2019 09:08:28 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 53227 invoked by uid 89); 24 Apr 2019 09:08:28 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-5.6 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.1 spammy=stand X-HELO: mail-vs1-f65.google.com Received: from mail-vs1-f65.google.com (HELO mail-vs1-f65.google.com) (209.85.217.65) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 24 Apr 2019 09:08:26 +0000 Received: by mail-vs1-f65.google.com with SMTP id w13so9962205vsc.4 for ; Wed, 24 Apr 2019 02:08:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=JqiQpT3jWs0HI5NHEEE/UBf3VPq0iw7+8hhlinXKUus=; b=j4IkWACO2r64+HPDfZ8fVin/gMc+arql6ntDHq8QbvJXsN6KpHZbqdKWpBKaL0QKRn wZ+XVhXrQYvUHCKX/0gAV7iKyzldRD+P7F65Rc6FQcmbO+hId/pafDEEi/mPVCv4hrZg S8Es6XD1bHf0WObzKwg868zW5p3KAiXIW3NtpYmUJFXB5bc1RRi+VzjC3P77Xv8vaSPw jbJaCVaHhMHQPlw21CPnaOsf14ouitsGdZtaDhZLp0P1da78AAX6bZ/7jF2xwBEOhBdv VLUDRx96aKg1sisUgBVB6uXtZUkUUiaCDkmKriRU+FyhoEpLa/s1NbfWKDrMKtR/soLK 3GXQ== MIME-Version: 1.0 References: <20190417110933.11244-1-claziss@gmail.com> <20190417112505.GU21066@tucnak> In-Reply-To: <20190417112505.GU21066@tucnak> From: Claudiu Zissulescu Date: Wed, 24 Apr 2019 09:20:00 -0000 Message-ID: Subject: Re: [PATCH] [ARC][COMMITTED] Fix diagnostic messages. To: Jakub Jelinek Cc: gcc-patches@gcc.gnu.org, Andrew Burgess , Francois Bedard Content-Type: text/plain; charset="UTF-8" X-IsSubscribed: yes X-SW-Source: 2019-04/txt/msg00915.txt.bz2 The DOC/DOC0/DOC1 are like keywords to be placed into the warning message. They shouldn't be translated as they can referenced directly in the specific processor architectural options. So, I will use %qs for them, and fix the other signalized problems. Thank you On Wed, Apr 17, 2019 at 2:25 PM Jakub Jelinek wrote: > > On Wed, Apr 17, 2019 at 02:09:33PM +0300, Claudiu Zissulescu wrote: > > /* Warn for unimplemented PIC in pre-ARC700 cores, and disable flag_pic. */ > > if (flag_pic && TARGET_ARC600_FAMILY) > > { > > warning (0, > > - "PIC is not supported for %s. Generating non-PIC code only..", > > + "PIC is not supported for %s. Generating non-PIC code only", > > arc_cpu_string); > > I believe this is undesirable too. Either use something like > "PIC is not supported for %s; generating non-PIC code only" > or split that into two messages > if (warning (0, "PIC is not supported for %s", arc_cpu_string)) > inform (input_location, "generating non-PIC code only"); > > > @@ -1222,26 +1222,26 @@ arc_override_options (void) > > do { \ > > if ((!(arc_selected_cpu->arch_info->flags & CODE)) \ > > && (VAR == VAL)) \ > > - error ("Option %s=%s is not available for %s CPU.", \ > > + error ("option %s=%s is not available for %s CPU", \ > > DOC0, DOC1, arc_selected_cpu->name); \ > > I think another complaint in the PR was that it is unclear what > those DOC0/DOC1/DOC strings stand for, if they are keywords on what > one writes on the command line or similar (then it should be quoted, > %qs or %<%s=%s%>), if it is something different, then maybe it is > not the right thing to construct a translatable sentence from that > error/warning gmsgid string and one or more words that are inserted > somewhere into the sentence. At least for the ARC_OPT the latter seems to > be the case, given e.g.: > ARC_OPT (FL_LL64, (1ULL << 5), MASK_LL64, "double load/store") > ARC_OPT (FL_BS, (1ULL << 6), MASK_BARREL_SHIFTER, "barrel shifter") > Is barrel shifter a keyword, or just random words added into the sentence? > If the latter, then the translators might want to translate that too, but in > that case together with the surroundings too. > ARC_OPT (FL_SPFP, (1ULL << 12), MASK_SPFP_COMPACT_SET, "single precission FPX") > ARC_OPT (FL_DPFP, (1ULL << 13), MASK_DPFP_COMPACT_SET, "double precission FPX") > has spelling errors, > s/precission/precision/g > > > if ((arc_selected_cpu->arch_info->dflags & CODE) \ > > && (VAR != DEFAULT_##VAR) \ > > && (VAR != VAL)) \ > > - warning (0, "Option %s is ignored, the default value %s" \ > > - " is considered for %s CPU.", DOC0, DOC1, \ > > + warning (0, "option %s is ignored, the default value %s" \ > > + " is considered for %s CPU", DOC0, DOC1, \ > > arc_selected_cpu->name); \ > > } while (0); > > #define ARC_OPT(NAME, CODE, MASK, DOC) \ > > do { \ > > if ((!(arc_selected_cpu->arch_info->flags & CODE)) \ > > && (target_flags & MASK)) \ > > - error ("Option %s is not available for %s CPU", \ > > + error ("option %s is not available for %s CPU", \ > > DOC, arc_selected_cpu->name); \ > > if ((arc_selected_cpu->arch_info->dflags & CODE) \ > > && (target_flags_explicit & MASK) \ > > && (!(target_flags & MASK))) \ > > - warning (0, "Unset option %s is ignored, it is always" \ > > - " enabled for %s CPU.", DOC, \ > > + warning (0, "unset option %s is ignored, it is always" \ > > + " enabled for %s CPU", DOC, \ > > arc_selected_cpu->name); \ > > } while (0); > > > > @@ -7268,7 +7268,8 @@ check_if_valid_regno_const (rtx *operands, int opno) > > case CONST_INT : > > return true; > > default: > > - error ("register number must be a compile-time constant. Try giving higher optimization levels"); > > + error ("register number must be a compile-time constant. " > > + "Try giving higher optimization levels"); > > Similarly to the above case. > > Jakub