public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] libstdc++: fix misleading indentation
@ 2020-08-24 11:26 Krystian Kuźniarek
  2020-09-10 15:53 ` Jonathan Wakely
  0 siblings, 1 reply; 2+ messages in thread
From: Krystian Kuźniarek @ 2020-08-24 11:26 UTC (permalink / raw)
  To: gcc-patches, libstdc++

Hi,

First of all, sorry, I must have sent it as quoted-printable so spaces and
tabs are preserved.

A description of the problem/bug and how your patch addresses it:
I've got a small patch for -Wmisleading-indentation in system headers.

Testcases:
N/A, it's only a warning.

ChangeLog:
Sorry, contrib/mklog.py didn't quite work for me.
For some reason after instruction in line 129: "diff = PatchSet(data)" my
"diff" variable is always empty.

Bootstrapping and testing:
Tested that manually by recompling GCC, unfolding all headers with
`#include <stdc++.h>` and compiling what's been included by it.

The patch itself:

diff --git a/libstdc++-v3/include/bits/locale_facets_nonio.tcc
b/libstdc++-v3/include/bits/locale_facets_nonio.tcc
index 17b12c92f6c..7f40a0b306a 100644
--- a/libstdc++-v3/include/bits/locale_facets_nonio.tcc
+++ b/libstdc++-v3/include/bits/locale_facets_nonio.tcc
@@ -459,7 +459,7 @@ _GLIBCXX_BEGIN_NAMESPACE_LDBL_OR_CXX11
   	      {
 		if (__lc->_M_frac_digits < 0)
 		  __paddec = __len;
-  		if (__lc->_M_grouping_size)
+		if (__lc->_M_grouping_size)
   		  {
 		    __value.assign(2 * __paddec, char_type());
  		    _CharT* __vend =
@@ -469,9 +469,9 @@ _GLIBCXX_BEGIN_NAMESPACE_LDBL_OR_CXX11
 					  __beg, __beg + __paddec);
 		    __value.erase(__vend - &__value[0]);
   		  }
-  		else
+		else
 		  __value.assign(__beg, __paddec);
-	      }
+  	      }

 	    // Deal with decimal point, decimal digits.
 	    if (__lc->_M_frac_digits > 0)



Best regards,
Krystian

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] libstdc++: fix misleading indentation
  2020-08-24 11:26 [PATCH] libstdc++: fix misleading indentation Krystian Kuźniarek
@ 2020-09-10 15:53 ` Jonathan Wakely
  0 siblings, 0 replies; 2+ messages in thread
From: Jonathan Wakely @ 2020-09-10 15:53 UTC (permalink / raw)
  To: Krystian Kuźniarek; +Cc: gcc-patches, libstdc++

[-- Attachment #1: Type: text/plain, Size: 1780 bytes --]

On 24/08/20 13:26 +0200, Krystian Kuźniarek via Libstdc++ wrote:
>Hi,
>
>First of all, sorry, I must have sent it as quoted-printable so spaces and
>tabs are preserved.
>
>A description of the problem/bug and how your patch addresses it:
>I've got a small patch for -Wmisleading-indentation in system headers.

Ugh, the whitespace in that file is a mess. I can't reproduce this
warning though.

I'll commit a slightly different fix though. Thanks for pointing it
out.


>Testcases:
>N/A, it's only a warning.
>
>ChangeLog:
>Sorry, contrib/mklog.py didn't quite work for me.
>For some reason after instruction in line 129: "diff = PatchSet(data)" my
>"diff" variable is always empty.
>
>Bootstrapping and testing:
>Tested that manually by recompling GCC, unfolding all headers with
>`#include <stdc++.h>` and compiling what's been included by it.
>
>The patch itself:
>
>diff --git a/libstdc++-v3/include/bits/locale_facets_nonio.tcc
>b/libstdc++-v3/include/bits/locale_facets_nonio.tcc
>index 17b12c92f6c..7f40a0b306a 100644
>--- a/libstdc++-v3/include/bits/locale_facets_nonio.tcc
>+++ b/libstdc++-v3/include/bits/locale_facets_nonio.tcc
>@@ -459,7 +459,7 @@ _GLIBCXX_BEGIN_NAMESPACE_LDBL_OR_CXX11
>   	      {
> 		if (__lc->_M_frac_digits < 0)
> 		  __paddec = __len;
>-  		if (__lc->_M_grouping_size)
>+		if (__lc->_M_grouping_size)
>   		  {
> 		    __value.assign(2 * __paddec, char_type());
>  		    _CharT* __vend =
>@@ -469,9 +469,9 @@ _GLIBCXX_BEGIN_NAMESPACE_LDBL_OR_CXX11
> 					  __beg, __beg + __paddec);
> 		    __value.erase(__vend - &__value[0]);
>   		  }
>-  		else
>+		else
> 		  __value.assign(__beg, __paddec);
>-	      }
>+  	      }
>
> 	    // Deal with decimal point, decimal digits.
> 	    if (__lc->_M_frac_digits > 0)
>
>
>
>Best regards,
>Krystian
>

[-- Attachment #2: patch.txt --]
[-- Type: text/x-patch, Size: 1546 bytes --]

commit a1d67baf72933c8a2ed3e2b6459e02e2d01caef2
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Thu Sep 10 16:52:50 2020

    libstdc++: Clean up inconsistent whitespace
    
    libstdc++-v3/ChangeLog:
    
            * include/bits/locale_facets_nonio.tcc: Adjust whitespace.

diff --git a/libstdc++-v3/include/bits/locale_facets_nonio.tcc b/libstdc++-v3/include/bits/locale_facets_nonio.tcc
index 17b12c92f6c..ff84d7349cd 100644
--- a/libstdc++-v3/include/bits/locale_facets_nonio.tcc
+++ b/libstdc++-v3/include/bits/locale_facets_nonio.tcc
@@ -456,20 +456,20 @@ _GLIBCXX_BEGIN_NAMESPACE_LDBL_OR_CXX11
 	    // grouping rules.
 	    long __paddec = __len - __lc->_M_frac_digits;
 	    if (__paddec > 0)
-  	      {
+	      {
 		if (__lc->_M_frac_digits < 0)
 		  __paddec = __len;
-  		if (__lc->_M_grouping_size)
-  		  {
+		if (__lc->_M_grouping_size)
+		  {
 		    __value.assign(2 * __paddec, char_type());
- 		    _CharT* __vend = 
+		    _CharT* __vend =
 		      std::__add_grouping(&__value[0], __lc->_M_thousands_sep,
 					  __lc->_M_grouping,
 					  __lc->_M_grouping_size,
 					  __beg, __beg + __paddec);
 		    __value.erase(__vend - &__value[0]);
-  		  }
-  		else
+		  }
+		else
 		  __value.assign(__beg, __paddec);
 	      }
 
@@ -485,7 +485,7 @@ _GLIBCXX_BEGIN_NAMESPACE_LDBL_OR_CXX11
 		    __value.append(-__paddec, __lit[money_base::_S_zero]);
 		    __value.append(__beg, __len);
 		  }
-  	      }
+	      }
   
 	    // Calculate length of resulting string.
 	    const ios_base::fmtflags __f = __io.flags() 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-09-10 15:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-24 11:26 [PATCH] libstdc++: fix misleading indentation Krystian Kuźniarek
2020-09-10 15:53 ` Jonathan Wakely

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 read-only IMAP folder(s) and NNTP newsgroup(s).