Bug 99884 - Double spaces in warning message
Summary: Double spaces in warning message
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: fortran (show other bugs)
Version: 11.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL: https://gcc.gnu.org/pipermail/gcc-pat...
Keywords: diagnostic, patch
Depends on:
Blocks: trivial_translation_nits
  Show dependency treegraph
 
Reported: 2021-04-02 17:55 UTC by Göran Uddeborg
Modified: 2024-08-18 20:14 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2021-10-31 00:00:00


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Göran Uddeborg 2021-04-02 17:55:55 UTC
At https://gcc.gnu.org/git/?p=gcc.git;a=blob;f=gcc/fortran/io.c;h=40cd76eb5858614c81de98b59a4f6e5b814988ea;hb=HEAD#l2494 the variable "spec" is either set to a string followed by a space, or an empty string. This seems like a good way to be able to create a correct error message when there is a valid string to print but avoid an extra space when not. But when actually used in a message a few lines below, this feature is not taken advantage of, and the specifier is followed by a space regardless. That will make two spaces if there is a valid string, and one useless space when "spec" is empty.

Unless I miss something the message string should begin "%sspecifier at %L not  …"
Comment 1 Bernhard Reutner-Fischer 2021-10-31 17:35:24 UTC
Confirmed.
Comment 2 GCC Commits 2022-11-17 19:41:29 UTC
The master branch has been updated by Bernhard Reutner-Fischer <aldot@gcc.gnu.org>:

https://gcc.gnu.org/g:19be89d79ee149e812ccc6027956cefb7f3e1016

commit r13-4133-g19be89d79ee149e812ccc6027956cefb7f3e1016
Author: Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
Date:   Sun Oct 31 13:57:46 2021 +0100

    Fortran: Remove double spaces in open() warning [PR99884]
    
    gcc/fortran/ChangeLog:
    
            PR fortran/99884
            * io.cc (check_open_constraints): Remove double spaces.
Comment 3 anlauf 2024-08-18 20:06:36 UTC
Fixed almost 2 years ago.  Anything left?
Comment 4 Göran Uddeborg 2024-08-18 20:14:50 UTC
Looks fine to me.