Re: [wwwdocs] document new options in gcc-8/changes.html

2018-04-12 Thread Jason Merrill
On Wed, Apr 11, 2018 at 10:02 PM, Martin Sebor  wrote:
> On 04/04/2018 05:03 PM, Paolo Carlini wrote:
>>
>> Hi Martin
>>
>> On 05/04/2018 00:28, Martin Sebor wrote:
>>>
>>> +  implementations do suppresses the warning.
>>
>> suppress
>
>
> I was about to fix this but re-reading the full sentence made
> me realize it's correct as is:
>
>   Note that due to GCC bug 82944, defining strncat, strncpy, or
>   stpncpy as a macro in a system header as some implementations
>   do suppresses the warning.
>
> I've added a comma after the suppresses to make it clearer and
> checked in revision 1.63.

Sounds good, though you will also want a matching comma after "system header".

Jason


Re: [wwwdocs] document new options in gcc-8/changes.html

2018-04-11 Thread Martin Sebor

On 04/04/2018 05:03 PM, Paolo Carlini wrote:

Hi Martin

On 05/04/2018 00:28, Martin Sebor wrote:

+  implementations do suppresses the warning.

suppress


I was about to fix this but re-reading the full sentence made
me realize it's correct as is:

  Note that due to GCC bug 82944, defining strncat, strncpy, or
  stpncpy as a macro in a system header as some implementations
  do suppresses the warning.

I've added a comma after the suppresses to make it clearer and
checked in revision 1.63.

Martin


Re: [wwwdocs] document new options in gcc-8/changes.html

2018-04-11 Thread Jason Merrill
OK.

On Wed, Apr 11, 2018 at 3:13 PM, Martin Sebor  wrote:
> Ping: https://gcc.gnu.org/ml/gcc-patches/2018-04/msg00219.html
>
> There's one outstanding typo that Paolo noticed since I posted
> the update.  I'll fix that before committing.
>
>
> On 04/04/2018 04:28 PM, Martin Sebor wrote:
>>
>> Attached is an updated diff rebased on top of the latest revision
>> of the file.  This new version fixes the typos Paolo pointed out
>> (thanks) and adds a few more options:
>>
>> -Wmissing-attributes, -Wif-not-aligned, and -Wpacked-not-aligned.
>>
>> I used a spell-checker this time to (hopefully) minimize the typos.
>>
>> The rest of the changes are described here:
>> https://gcc.gnu.org/ml/gcc-patches/2018-04/msg00121.html
>>
>> Martin
>
>


Re: [wwwdocs] document new options in gcc-8/changes.html

2018-04-11 Thread Martin Sebor

Ping: https://gcc.gnu.org/ml/gcc-patches/2018-04/msg00219.html

There's one outstanding typo that Paolo noticed since I posted
the update.  I'll fix that before committing.

On 04/04/2018 04:28 PM, Martin Sebor wrote:

Attached is an updated diff rebased on top of the latest revision
of the file.  This new version fixes the typos Paolo pointed out
(thanks) and adds a few more options:

-Wmissing-attributes, -Wif-not-aligned, and -Wpacked-not-aligned.

I used a spell-checker this time to (hopefully) minimize the typos.

The rest of the changes are described here:
https://gcc.gnu.org/ml/gcc-patches/2018-04/msg00121.html

Martin




Re: [wwwdocs] document new options in gcc-8/changes.html

2018-04-04 Thread Paolo Carlini

Hi Martin

On 05/04/2018 00:28, Martin Sebor wrote:

+ implementations do suppresses the warning.

suppress

Paolo.


Re: [wwwdocs] document new options in gcc-8/changes.html

2018-04-04 Thread Martin Sebor

Attached is an updated diff rebased on top of the latest revision
of the file.  This new version fixes the typos Paolo pointed out
(thanks) and adds a few more options:

-Wmissing-attributes, -Wif-not-aligned, and -Wpacked-not-aligned.

I used a spell-checker this time to (hopefully) minimize the typos.

The rest of the changes are described here:
https://gcc.gnu.org/ml/gcc-patches/2018-04/msg00121.html

Martin
Index: changes.html
===
RCS file: /cvs/gcc/wwwdocs/htdocs/gcc-8/changes.html,v
retrieving revision 1.52
diff -u -r1.52 changes.html
--- changes.html	4 Apr 2018 17:43:03 -	1.52
+++ changes.html	4 Apr 2018 22:21:49 -
@@ -1,4 +1,4 @@
-
+
 
 
 GCC 8 Release Series  Changes, New Features, and Fixes
@@ -9,7 +9,7 @@
 -->
 
 
-GCC 8 Release SeriesChanges, New Features, and Fixes
+GCC 8 Release SeriesChanges, New Features, and Fixes
 
 
 This page is a "brief" summary of some of the huge number of improvements
@@ -113,6 +113,20 @@
 possible for the user to have a finer-grained control over the loop
 unrolling optimization.
   
+  
+GCC has been enhanced to detect more instances of meaningless or
+mutually exclusive attribute specifications and handle such conflicts
+more consistently.  Mutually exclusive attribute specifications are
+ignored with a warning regardless of whether they appear on the same
+declaration or on distinct declarations of the same entity.  For
+example, because the noreturn attribute on the second
+declaration below is mutually exclusive with the malloc
+attribute on the first, it is ignored and a warning is issued.
+
+  void* __attribute__ ((malloc)) f (unsigned);
+  void* __attribute__ ((noreturn)) f (unsigned);
+
+  warning: ignoring attribute 'noreturn' because it conflicts with attribute 'malloc' [-Wattributes]
 
 
 
@@ -172,10 +186,77 @@
 
 New command-line options have been added for the C and C++ compilers:
   
-	-Wmultistatement-macros warns about unsafe macros
-	expanding to multiple statements used as a body of a clause such
-	as if, else, while,
-	switch, or for.
+	https://gcc.gnu.org/onlinedocs/gcc-8.1.0/gcc/Warning-Options.html#index-Wmultistatement-macros;>-Wmultistatement-macros
+	  warns about unsafe macros expanding to multiple statements used
+	  as a body of a statement such as if, else,
+	  while, switch, or for.
+	https://gcc.gnu.org/onlinedocs/gcc-8.1.0/gcc/Warning-Options.html#index-Wstringop-truncation;>-Wstringop-truncation
+	  warns for calls to bounded string manipulation functions such as
+	  strncat, strncpy, and stpncpy
+	  that might either truncate the copied string or leave the destination
+	  unchanged.  For example, the following call to strncat
+	  is diagnosed because it appends just three of the four characters
+	  from the source string.
+	void append (char *buf, size_t bufsize)
+	{
+	strncat (buf, ".txt", 3);
+	}
+	warning: 'strncat' output truncated copying 3 bytes from a string of length 4 [-Wstringop-truncation]
+	  Similarly, in the following example, the call to strncpy
+	  specifies the size of the destination buffer as the bound.  If the
+	  length of the source string is equal to or greater than this size
+	  the result of the copy will not be NUL-terminated.  Therefore,
+	  the call is also diagnosed.  To avoid the warning, specify
+	  sizeof buf - 1 as the bound and set the last element of
+	  the buffer to NUL.
+	void copy (const char *s)
+	{
+	char buf[80];
+	strncpy (buf, s, sizeof buf);
+	
+	}
+	warning: 'strncpy' specified bound 80 equals destination size [-Wstringop-truncation]
+	  The -Wstringop-truncation option is included in
+	  -Wall.
+	  Note that due to GCC bug https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82944; title="missing -Wstringop-truncation on strncpy due to system header macro">82944, defining strncat, strncpy,
+	  or stpncpy as a macro in a system header as some
+	  implementations do suppresses the warning.
+	https://gcc.gnu.org/onlinedocs/gcc-8.1.0/gcc/Warning-Options.html#index-Wif-not-aligned;>-Wif-not-aligned controls warnings issued in response
+	  to invalid uses of objects declared with attribute
+	  https://gcc.gnu.org/onlinedocs/gcc-8.1.0/gcc/Common-Variable-Attributes.html#index-warn_005fif_005fnot_005faligned-variable-attribute;>warn_if_not_aligned.
+	  The -Wif-not-aligned option is included in
+	  -Wall.
+	https://gcc.gnu.org/onlinedocs/gcc-8.1.0/gcc/Warning-Options.html#index-Wmissing-attributes;>-Wmissing-attributes warns
+	  when a declaration of a function is missing one or more attributes
+	  that a related function is declared with and whose absence may
+	  adversely affect the correctness or efficiency of generated code.
+	  For example, in C++, the warning is issued when an explicit
+	  specialization of a primary template declared with attribute
+	  alloc_align, alloc_size,
+	  

Re: [wwwdocs] document new options in gcc-8/changes.html

2018-04-03 Thread Paolo Carlini

Hi again ;)

On 03/04/2018 22:54, Martin Sebor wrote:

+more consistently.  Mutually excclusive attribute specifications are

exclusive

Paolo.


Re: [wwwdocs] document new options in gcc-8/changes.html

2018-04-03 Thread Paolo Carlini

Hi,

On 03/04/2018 22:54, Martin Sebor wrote:

+mutually exclusive attribute specifications and hande such conflicts

handle

Thanks,
Paolo.


Re: [wwwdocs] document new options in gcc-8/changes.html

2018-04-03 Thread Paolo Carlini

Oh my,

On 03/04/2018 22:54, Martin Sebor wrote:

+declaration or on distinct declarations of the same entitiy.  For

entity

It's getting late here in Italy, I would recommend a systematic check of 
the typos.


Paolo.