Attached is a minimal patch to avoid an ICE in CHKP upon
encountering one form of an initializer for a flexible array
member, specifically the empty string:
int f ()
{
struct B { int n; char a[]; };
return ((struct B){ 1, "" }).a[0];
}
Although GCC accepts (and doesn't ICE on)
On 03/20/2017 05:51 PM, Jason Merrill wrote:
On Mon, Mar 20, 2017 at 7:04 PM, Martin Sebor <mse...@gmail.com> wrote:
Attached is a minimal patch to avoid an ICE in CHKP upon
encountering one form of an initializer for a flexible array
member, specifically the empty string:
On 03/12/2017 05:23 PM, Gerald Pfeifer wrote:
Hi Martin,
On Mon, 27 Feb 2017, Martin Sebor wrote:
Sorry to be jumping in so late. I only noticed this bit now.
I would suggest to say that these new built-ins evaluate to integer
constant expressions when their arguments do. Not all C
In formal writing it's recommended to prefer the word "cannot"
to the somewhat informal "can't."
The GCC manual uses "cannot" in most places (280 lines) but there
are a few instances of "can't" (33 lines).
The attached patch replaces the informal "can't" with the former
for consistency.
Thanks
In bug 52477 - Wrong initialization order? attribute constructor
vs static data access, the reporter expects C++ objects with static
storage duration to have their ctors called in the same order as
those of functions declared with attribute constructor interleaved
with them.
In his comment on
On 03/15/2017 05:00 AM, Richard Kenner wrote:
First, I agree that the less formal language is becoming more
acceptable. Some style guides explicitly allow contractions,
but others advise against them. The technical specifications
that significant parts of GCC aim to conform to, and those I
On 03/15/2017 09:40 AM, Martin Sebor wrote:
On 03/15/2017 05:00 AM, Richard Kenner wrote:
First, I agree that the less formal language is becoming more
acceptable. Some style guides explicitly allow contractions,
but others advise against them. The technical specifications
that significant
On 03/20/2017 10:53 AM, Jakub Jelinek wrote:
On Mon, Mar 20, 2017 at 10:44:25AM -0600, Martin Sebor wrote:
/home/marek/src/gcc/gcc/sanitizer.def:459:1: note: in expansion of macro
‘DEF_SANITIZER_BUILTIN’
DEF_SANITIZER_BUILTIN(BUILT_IN_UBSAN_HANDLE_TYPE_MISMATCH_ABORT
I would view
On 03/20/2017 07:42 AM, Marek Polacek wrote:
On Mon, Mar 20, 2017 at 09:37:10AM -0400, Jason Merrill wrote:
On Mon, Mar 20, 2017 at 9:28 AM, Marek Polacek wrote:
#define DEF_SANITIZER_BUILTIN(ENUM, NAME, TYPE, ATTRS) \
+ do {
I'm not 100% sure I understand what changes you're suggesting
but the attached patch does what I think you're after. Is that
what you had in mind?
Looks good.
Thanks. I just committed it to trunk but forgot to ask for approval
to backport it to 6 and 5.
Martin
Since I've also spent some time on this: my take on this is that the C++ FE
should just follow C FE's suit and reject such initializations where
possible; it seems they've never worked reliably anyway, and bring more
harm than good. I don't see that rejecting such code would cause too much
On 03/14/2017 01:41 PM, Richard Sandiford wrote:
Martin Sebor <mse...@gmail.com> writes:
@@ -373,7 +373,7 @@ example, this code would produce an error:
@smallexample
#if 0
-You can't expect this to work.
+You cannot expect this to work.
#endif
@end smallexample
Sure the maint
On 03/14/2017 02:53 PM, Richard Kenner wrote:
The GCC manual uses "cannot" in most places (280 lines) but there
are a few instances of "can't" (33 lines).
The attached patch replaces the informal "can't" with the former
for consistency.
In my opinion, this is the wrong direction.
PR 80047 - fixincludes/fixincl.c: PVS-Studio: Improper Release
of Memory Before Removing Last Reference (CWE-401) points out
that the fixincludes program calls getcwd with the first argument
set to NULL, apparently a Glibc extension, to have the function
allocate the memory to which it then
@@ -972,11 +972,11 @@ get_int_range (tree arg, tree type, HOST_WIDE_INT *pmin,
HOST_WIDE_INT *pmax,
if (range_type == VR_RANGE)
{
HOST_WIDE_INT type_min
- = (TYPE_UNSIGNED (type)
- ? tree_to_uhwi (TYPE_MIN_VALUE (type))
-
tsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,6 +1,11 @@
+2017-04-10 Martin Sebor <mse...@redhat.com>
+
+ * gcc.dg/pr40340-3.c: Adjust directive pattern.
+ * gcc.dg/pr40340-4.c: Same.
+
2017-04-10 Nicolas Koenig <koeni...@student.ethz.ch>
- PR fortran/69498
In a review of my fix for bug 80364 Jakub pointed out that to
determine whether an argument to an integer directive is of
an integer type the gimple-ssa-sprintf pass tests the type code
for equality to INTEGER_TYPE when it should instead be using
INTEGRAL_TYPE_P(). This has the effect of the
if (TREE_CODE (arg) == SSA_NAME
- && TREE_CODE (type) == INTEGER_TYPE)
+ && TREE_CODE (argtype) == INTEGER_TYPE
I think you want
&& INTEGRAL_TYPE_P (argtype)
here instead of that last line, the middle-end considers conversions between
integral types useless
On 03/29/2017 04:23 AM, Dominik Vogt wrote:
The attached patch removes the XFAIL in attr-alloc_size-11.c on
s390. (PR 79356).
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79356
Untested.
It looks like the only target the test does fail on is x86.
The attached patch simplifies the test to
Bug 80364 - sanitizer detects signed integer overflow in
gimple-ssa-sprintf.c, points out a runtime error (integer
overflow when negating LONG_MIN) triggered by the undefined
saniziter for an invalid test case recently added to the test
suite. The test case passes an argument of type long as
the
On 04/12/2017 04:03 PM, Jeff Law wrote:
On 04/04/2017 07:10 PM, Damian Rouson wrote:
All,
The attached patch modifies the contrib/download_prerequisites script
to work on macOS.
The revised script detects the operating system and adjusts the shasum
and md5 commands
to their expected name and
PR libstdc++/54924 - Warn for std::string constructor with wrong
size asks for a warning when constructing a std::string from
a character array and a number of elements that's in excess of
the number of elements. E.g.,
std::string s ("abc", 7);
PR middle-end/79234 - warn on past the end
nce to validate them.
The attached patch moves the transformation from gimple-fold.c
into the gimple-ssa-sprintf.c pass, thus allowing the calls to
be validated. Only valid calls (i.e., those that do not overflow
the destination) are transformed.
Martin
commit 2cd98763984ffb93606ee96ad658733b4c95c1e4
On 03/09/2017 10:45 AM, David Malcolm wrote:
gcc/ChangeLog:
PR driver/79875
* opts.c (parse_sanitizer_options): Add missing question mark to
"did you mean" message.
---
gcc/opts.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/gcc/opts.c b/gcc/opts.c
On 03/09/2017 10:45 AM, David Malcolm wrote:
PR target/79926 notes that in:
sorry ("%s instructions aren't allowed in %s service routine",
isa, (cfun->machine->func_type == TYPE_EXCEPTION
? "exception" : "interrupt"));
the text from the second %s won't be
r243470 decorates standard allocation functions like alloca
and malloc with attribute alloc_size. However, in applying
the attribute to aligned_alloc I had overlooked that the size
argument is the second one and not the first. That oversight
has led to __builtin_object_size() reporting the
On 03/10/2017 10:51 PM, Jeff Law wrote:
On 03/10/2017 09:20 AM, Martin Sebor wrote:
On 03/10/2017 05:57 AM, Rainer Orth wrote:
Hi Segher,
On Fri, Feb 10, 2017 at 11:56:39AM +0100, Rainer Orth wrote:
Segher Boessenkool <seg...@kernel.crashing.org> writes:
As stated in the PR, this te
On 03/10/2017 05:57 AM, Rainer Orth wrote:
Hi Segher,
On Fri, Feb 10, 2017 at 11:56:39AM +0100, Rainer Orth wrote:
Segher Boessenkool writes:
As stated in the PR, this test now passes on aarch64, ia64, powerpc,
and s390x. This patch disables the xfails for
Ping: this a P3 regression targeted at 7.0.1. It was found
on x86_64-apple-darwin10.8.0 but affects all targets (even
if it doesn't happen to manifest on them):
https://gcc.gnu.org/ml/gcc-patches/2017-03/msg00342.html
On 03/07/2017 06:03 PM, Martin Sebor wrote:
In bug 79936 - ICE
The output of a floating point directive whose precision is
specified by an asterisk with an argument that's in a range
that includes both negative and positive values less than
six may include between zero and six fractional digits plus
a decimal point. For example,
printf ("%.*e", p, x);
On 03/13/2017 04:34 PM, Bruce Korb wrote:
On 03/13/17 15:02, Gerald Pfeifer wrote:
On Mon, 13 Mar 2017, Joseph Myers wrote:
I am currently translating GCC into German. During that, I noticed that
in some places the term "zero character" means '\0'. The official term
though is "null character",
On 03/02/2017 02:40 PM, Andrew Pinski wrote:
On Thu, Mar 2, 2017 at 1:33 PM, Martin Sebor <mse...@gmail.com> wrote:
On 03/02/2017 01:08 AM, Richard Biener wrote:
On Thu, Mar 2, 2017 at 2:01 AM, Joseph Myers <jos...@codesourcery.com>
wrote:
On Wed, 1 Mar 2017, Martin Sebor wro
On 03/02/2017 12:58 AM, Richard Biener wrote:
On Wed, 1 Mar 2017, Martin Sebor wrote:
On 02/28/2017 11:41 PM, Richard Biener wrote:
On March 1, 2017 3:34:46 AM GMT+01:00, Martin Sebor <mse...@gmail.com>
wrote:
On 02/28/2017 01:41 PM, Richard Biener wrote:
On February 28, 2017 7:00:39
On 03/02/2017 01:08 AM, Richard Biener wrote:
On Thu, Mar 2, 2017 at 2:01 AM, Joseph Myers <jos...@codesourcery.com> wrote:
On Wed, 1 Mar 2017, Martin Sebor wrote:
Joseph, since you commented on the bug, do you have a suggestion
for a different site for it or a guard? The only othe
In bug 79936 - ICE with -Walloc-size-larger-than=32767 the reporter
encountered an ICE on x86_64-apple-darwin10.8.0 caused by GCC source
file that implements the warning accessing a global tree without
having included the file in GTFILES make variable. (Thanks again
to David Malcolm who helped
The following one-line patch corrects the spelling of the error
message in the nds32 back end pointed out by a translator. I'll
go ahead and commit it as trivial unless there are objections in
the next day or so.
Martin
2017-03-07 Martin Sebor <mse...@redhat.com>
* gcc/config
On 03/20/2017 10:27 PM, Jason Merrill wrote:
On Mon, Mar 20, 2017 at 7:58 PM, Martin Sebor <mse...@gmail.com> wrote:
On 03/20/2017 05:51 PM, Jason Merrill wrote:
On Mon, Mar 20, 2017 at 7:04 PM, Martin Sebor <mse...@gmail.com> wrote:
Attached is a minimal patch to avoid an ICE
On 04/13/2017 05:29 PM, Damian Rouson wrote:
Resending as plain text:
On April 12, 2017 at 3:03:19 PM, Jeff Law
(l...@redhat.com(mailto:l...@redhat.com)) wrote:
> >
> > 2017-04-05 Damian Rouson
> >
> > * download_prerequisites (md5_check): New function emulates Linux
> > 'md5 --check'
On 04/23/2017 03:38 PM, Marc Glisse wrote:
Hello,
this patches teaches tree_expr_nonzero_warnv_p to handle SSA_NAME using
range information and known (non-)zero bits, by delegating to
expr_not_equal_to which already knows how to handle all that.
This makes one strict overflow warning
Bug 80497 brings to light that my fix for PR 80364 where I corrected
the handling for int128_t was incomplete. I handled the non-constant
case but missed the INTEGER_CST case just a few lines above. The
attached patch also corrects that problem plus one more elsewhere
in the pass.
Both of the
On 07/31/2017 08:14 AM, Marek Polacek wrote:
This patch improves the diagnostic of -Wsign-compare for ?: by also printing
the types, similarly to my recent patch. But we can do even better here if we
actually point to the operand in question, so I passed the locations of the
operands from the
On 07/27/2017 01:13 PM, Richard Sandiford wrote:
Martin Sebor <mse...@gmail.com> writes:
On 07/23/2017 02:42 PM, Volker Reichelt wrote:
On 21 Jul, Martin Sebor wrote:
On 07/20/2017 10:35 AM, Volker Reichelt wrote:
Hi,
the following patch introduces a new C++ warning option
-Wdupl
On 07/27/2017 02:30 AM, tbsaunde+...@tbsaunde.org wrote:
From: Trevor Saunders
The preC++ way of passing information about the call site of a function was to
use a macro that passed __file__, __LINE__, and __FUNCTION__ to a function with
the same name with _stat
So I think the fixes exposed by the new warning are OK to go in as-is
immediately if you wish to do so. Minor questions on the actual
improved warnings inline.
Sure, thanks.
-static inline tree
+static tree
compute_objsize (tree dest, int ostype)
{
...
+ type = TYPE_MAIN_VARIANT
On 07/31/2017 10:05 AM, Marek Polacek wrote:
On Mon, Jul 31, 2017 at 09:54:03AM -0600, Martin Sebor wrote:
On 07/31/2017 08:14 AM, Marek Polacek wrote:
This patch improves the diagnostic of -Wsign-compare for ?: by also printing
the types, similarly to my recent patch. But we can do even
I'm wondering if the messages could use a slight rewording, to give a
clue to the user about the reason *why* the expression has changed
signedness. The old message "signed and unsigned type in conditional
expression" gave the clue (but failed to underline the subexpression
changing sign, and
On 08/02/2017 01:04 PM, Jeff Law wrote:
On 07/28/2017 05:13 AM, Martin Liška wrote:
Hello.
Following patch skips empty strings in 'target' attribute.
Patch can bootstrap on ppc64le-redhat-linux and survives regression tests.
Ready to be installed?
Martin
gcc/ChangeLog:
2017-07-13 Martin
This is a small readability tweak to the tree printer to have
it consistently use dashes and colons in tree attribute names
in favor of spaces. It's been tested on x86_64-linux.
The tree printer tends to avoid using spaces to separate tree
attribute names (not the __attribute__ kind but things
On 08/15/2017 07:27 AM, Jonathan Wakely wrote:
On 15 August 2017 at 04:10, Martin Sebor wrote:
On 08/14/2017 04:22 PM, Eric Gallager wrote:
I'm emailing this manually to the list because Bugzilla is down and I
can't file a bug on Bugzilla about Bugzilla being down. The error
message looks
On 08/15/2017 10:27 AM, Joseph Myers wrote:
On Tue, 15 Aug 2017, Martin Sebor wrote:
It looks like the data loss extends beyond 8/14. Bug 81840
was created Sunday afternoon but is not in the database:
https://gcc.gnu.org/ml/gcc-bugs/2017-08/msg01303.html
(Strangely, 81841
Bug 81859 points out that my fix for bug 81586 wasn't quite
right (or complete): the argument of a %.*s directive need
not be a nul-terminated string when the precision is less
than the initialized size of the array the argument points
to. The attached tweak uses strnlen to avoid reading past
On 08/14/2017 12:09 PM, Joseph Myers wrote:
On Mon, 14 Aug 2017, Martin Sebor wrote:
I assumed every attribute needed to define an identifier but
nothing broke after I removed it so it looks like you're right
variable attributes don't need one. Go figure. It would be
nice
On 08/14/2017 01:50 PM, Joseph Myers wrote:
On Mon, 14 Aug 2017, Martin Sebor wrote:
/* This header provides a declarative way of describing the attributes
- that are applied to some functions by default.
+ that are applied to some built-in functions by default. Attributes
+ that apply
On 08/09/2017 10:44 PM, Jeff Law wrote:
On 08/06/2017 02:07 PM, Martin Sebor wrote:
The attached patch adds support for a new GCC format specifier,
G, that behaves like %K but accepts a gcall* argument. This
makes it possible to provide inlining context for "artificial"
inline func
On 08/10/2017 01:29 PM, Martin Sebor wrote:
diff --git a/gcc/builtins.c b/gcc/builtins.c
index 016f68d..1aa9e22 100644
--- a/gcc/builtins.c
+++ b/gcc/builtins.c
[ ... ]
+
+ if (TREE_CODE (type) == ARRAY_TYPE)
+{
+ /* Return the constant size unless it's zero (that's a
zero-length
On 08/14/2017 04:22 PM, Eric Gallager wrote:
I'm emailing this manually to the list because Bugzilla is down and I
can't file a bug on Bugzilla about Bugzilla being down. The error
message looks like this:
Bugzilla and the rest of gcc.gnu.org have been down much of
the afternoon/evening due to
On 08/09/2017 01:55 PM, Joseph Myers wrote:
On Wed, 9 Aug 2017, Martin Sebor wrote:
the same function with the other of this pair attributes. I'd
also be okay with not diagnosing this combination if I could
convince myself that it's safe (or can be made safe) and treated
consistently.
I'd
On 08/10/2017 03:55 PM, Joseph Myers wrote:
On Wed, 9 Aug 2017, Martin Sebor wrote:
The problem isn't that the declarations aren't merged at the call
site but rather that the middle-end gives const precedence over
pure so when both attributes are provided the former wins.
But that precedence
--- gcc/config/rs6000/rs6000-c.c(revision 250965)
+++ gcc/config/rs6000/rs6000-c.c(working copy)
@@ -5812,7 +5812,7 @@ altivec_resolve_overloaded_builtin (location_t loc
types. */
if (nargs != 2)
{
- error ("vec_mul only accepts 2 arguments");
+
The trivial tweak below removes the spurious space pointed out
in bug 79998 - typo in diagnostic "specified bound %wu". The
patch has been committed in r251096.
Martin
Index: gcc/gimple-ssa-sprintf.c
===
---
On 08/09/2017 11:00 PM, Jeff Law wrote:
On 08/06/2017 02:07 PM, Martin Sebor wrote:
Part 2 of the series adds attribute nostring to annotate arrays
of and pointers to char with that are intended to store sequences
of characters that aren't necessarily valid (nul-terminated)
strings
To make review easier I broke out the C++ changes for the attributes
work into a patch of their own. I also found the API I had asked
about, to look up a declaration based on one that's about to be
added/merged.
This patch depends on the foundation bits posted here:
diff --git a/gcc/builtins.c b/gcc/builtins.c
index 016f68d..1aa9e22 100644
--- a/gcc/builtins.c
+++ b/gcc/builtins.c
[ ... ]
+
+ if (TREE_CODE (type) == ARRAY_TYPE)
+{
+ /* Return the constant size unless it's zero (that's a zero-length
+array likely at the end of a struct).
A conflict in my patch for bug 81345 made me notice that r249734
recently added a new option property, IntegerRange. The change
below adds brief documentation of the property to the manual.
Martin, can you please check to make sure I didn't miss anything?
Btw., while experimenting with the
On 07/13/2017 08:18 AM, Marek Polacek wrote:
This patch improves diagnostic in the C FE by printing the types when reporting
a problem with a conversion. E.g., instead of
warning: assignment from incompatible pointer type
you'll now get
warning: assignment to 'int *' from incompatible
On 07/06/2017 07:25 AM, Daniel P. Berrange wrote:
There are several hundred named attribute keys that have been
introduced over many GCC releases. Applications typically need
to be compilable with multiple GCC versions, so it is important
for developers to know when GCC introduced support for
On 07/10/2017 05:27 PM, Joseph Myers wrote:
On Mon, 10 Jul 2017, Martin Sebor wrote:
On 07/07/2017 10:58 AM, Joseph Myers wrote:
This patch is OK.
Thanks. Committed in r250104.
Do you have any comments on or concerns with changing how
LangEnabledBy interprets the opt argument as I
On 07/11/2017 07:32 AM, Martin Liška wrote:
On 07/10/2017 05:08 PM, Martin Sebor wrote:
On 07/10/2017 02:35 AM, Martin Liška wrote:
On 07/07/2017 09:20 PM, Martin Sebor wrote:
A conflict in my patch for bug 81345 made me notice that r249734
recently added a new option property, IntegerRange
On 07/11/2017 09:24 AM, David Malcolm wrote:
[This patch kit is effectively just one patch; I've split it up into
3 parts, in the hope of making it easier to review:
the c-family parts, the C parts, and the C++ parts]
This patch adds a hint to the user to various errors generated
in the C
On 07/11/2017 12:32 PM, David Malcolm wrote:
On Tue, 2017-07-11 at 11:28 -0600, Martin Sebor wrote:
On 07/11/2017 09:24 AM, David Malcolm wrote:
[This patch kit is effectively just one patch; I've split it up
into
3 parts, in the hope of making it easier to review:
the c-family parts, the C
On 07/10/2017 03:36 AM, Martin Liška wrote:
Hi.
This adds missing quotes to various error messages related to AddressSanitizer.
Patch can bootstrap on ppc64le-redhat-linux and survives regression tests.
Ready to be installed?
Martin
gcc/ChangeLog:
2017-07-04 Martin Liska
to type ‘struct S’ [-Wuseless-cast]
rather than just
warning: useless cast to type ‘S’ [-Wuseless-cast]
as it still does now. More broadly, I wonder if types should
always (or by default) include the class-key or enum keyword
in C++? In C?
Martin
On 06/20/2017 10:09 AM, Martin Sebor wrote:
So
On 07/10/2017 02:35 AM, Martin Liška wrote:
On 07/07/2017 09:20 PM, Martin Sebor wrote:
A conflict in my patch for bug 81345 made me notice that r249734
recently added a new option property, IntegerRange. The change
below adds brief documentation of the property to the manual.
Martin, can you
On 07/07/2017 10:58 AM, Joseph Myers wrote:
This patch is OK.
Thanks. Committed in r250104.
Do you have any comments on or concerns with changing how
LangEnabledBy interprets the opt argument as I suggested below?
IMO, it makes little sense for an option that takes an argument
and that
Ping:
https://gcc.gnu.org/ml/gcc-patches/2017-07/msg00036.html
On 07/02/2017 02:00 PM, Martin Sebor wrote:
The attached patch enhances the -Wrestrict warning to detect more
than just trivial instances of overlapping copying by sprintf and
related functions.
The meat of the patch
PR 81117 asks for improved detection of common misuses(*) of
strncpy and strncat. The attached patch is my solution. It
consists of three related sets of changes:
1) Adds a new option, -Wstringop-truncation, that diagnoses calls
to strncpy, and stpncpy (and also strncat) that truncate the
On 07/12/2017 07:13 AM, Trevor Saunders wrote:
On Tue, Jul 11, 2017 at 11:24:45AM -0400, David Malcolm wrote:
+/* Some tokens naturally come in pairs e.g.'(' and ')'.
+ This class is for tracking such a matching pair of symbols.
+ In particular, it tracks the location of the first token,
+
On 06/21/2017 01:59 AM, Volker Reichelt wrote:
On 20 Jun, Jason Merrill wrote:
On Tue, Jun 20, 2017 at 3:06 PM, David Malcolm wrote:
It's not clear to me what the issue alluded to with negative
obstack_blank is, but I chose to follow the above docs and use
On 07/14/2017 09:40 AM, Martin Sebor wrote:
On 07/14/2017 07:47 AM, Marek Polacek wrote:
On Fri, Jul 14, 2017 at 02:52:36PM +0200, Marek Polacek wrote:
On Thu, Jul 13, 2017 at 11:42:15AM -0600, Martin Sebor wrote:
On 07/13/2017 08:18 AM, Marek Polacek wrote:
This patch improves diagnostic
On 07/14/2017 07:47 AM, Marek Polacek wrote:
On Fri, Jul 14, 2017 at 02:52:36PM +0200, Marek Polacek wrote:
On Thu, Jul 13, 2017 at 11:42:15AM -0600, Martin Sebor wrote:
On 07/13/2017 08:18 AM, Marek Polacek wrote:
This patch improves diagnostic in the C FE by printing the types when
Ping:
https://gcc.gnu.org/ml/gcc-patches/2017-07/msg00411.html
On 07/08/2017 02:45 PM, Martin Sebor wrote:
PR 81117 asks for improved detection of common misuses(*) of
strncpy and strncat. The attached patch is my solution. It
consists of three related sets of changes:
1) Adds a new
Ping #2:
https://gcc.gnu.org/ml/gcc-patches/2017-07/msg00036.html
On 07/02/2017 02:00 PM, Martin Sebor wrote:
The attached patch enhances the -Wrestrict warning to detect more
than just trivial instances of overlapping copying by sprintf and
related functions.
The meat of the patch
--- gcc/match.pd.jj 2017-07-17 16:25:20.0 +0200
+++ gcc/match.pd2017-07-18 12:32:52.896924558 +0200
@@ -1125,6 +1125,19 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT)
&& wi::neg_p (@1, TYPE_SIGN (TREE_TYPE (@1
(cmp @2 @0))
+/* (X - 1U) <= INT_MAX-1U into (int) X
On 07/18/2017 09:43 AM, Jakub Jelinek wrote:
On Tue, Jul 18, 2017 at 09:31:11AM -0600, Martin Sebor wrote:
--- gcc/match.pd.jj 2017-07-17 16:25:20.0 +0200
+++ gcc/match.pd2017-07-18 12:32:52.896924558 +0200
@@ -1125,6 +1125,19 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT
Being implemented in the front end, the -Wrestrict warning
detects only trivial instances of violations. The attached
patch extends the implementation to the middle-end where
data flow and alias analysis can be combined to detect even
complex cases of overlap. This work is independent of but
On 07/19/2017 12:42 AM, Jeff Law wrote:
On 07/02/2017 02:00 PM, Martin Sebor wrote:
The attached patch enhances the -Wrestrict warning to detect more
than just trivial instances of overlapping copying by sprintf and
related functions.
The meat of the patch is relatively simple but because
On 07/20/2017 10:35 AM, Volker Reichelt wrote:
Hi,
the following patch introduces a new C++ warning option
-Wduplicated-access-specifiers that warns about redundant
access-specifiers in classes, e.g.
class B
{
public:
B();
private:
void foo();
private:
int i;
How hard would it be to also suppress the warning for benign
comparisons like C++ manages to do? E.g., C warns on this
code even though there's no problem with it:
int foo (unsigned int b)
{
const int a = 1;
return (a < b);
}
Martin
On 07/25/2017 03:45 AM, Marek Polacek wrote:
+extern void do_something_interesting_and_never_return ();
+
+int
+foo1(int a)
+{ /* { dg-warning "cold" "detect cold candidate" { target *-*-* } "8" } */
+ if (a)
+abort ();
+ else
+abort ();
+}
In this case it looks to me like with the patch GCC will actually
issue two suggestions:
On 07/23/2017 02:42 PM, Volker Reichelt wrote:
On 21 Jul, Martin Sebor wrote:
On 07/20/2017 10:35 AM, Volker Reichelt wrote:
Hi,
the following patch introduces a new C++ warning option
-Wduplicated-access-specifiers that warns about redundant
access-specifiers in classes, e.g.
class B
On 07/17/2017 01:17 PM, Martin Sebor wrote:
On 07/10/2017 05:27 PM, Joseph Myers wrote:
On Mon, 10 Jul 2017, Martin Sebor wrote:
On 07/07/2017 10:58 AM, Joseph Myers wrote:
This patch is OK.
Thanks. Committed in r250104.
Do you have any comments on or concerns with changing how
Ping:
https://gcc.gnu.org/ml/gcc-patches/2017-07/msg01264.html
This change is related to
[PATCH] enhance -Wrestrict for sprintf %s arguments
https://gcc.gnu.org/ml/gcc-patches/2017-07/msg01176.html
On 07/20/2017 02:45 PM, Martin Sebor wrote:
With more testing (building GDB, Glibc
Ping: Jeff, please see my reply below.
On 07/19/2017 10:10 AM, Martin Sebor wrote:
On 07/19/2017 12:42 AM, Jeff Law wrote:
On 07/02/2017 02:00 PM, Martin Sebor wrote:
The attached patch enhances the -Wrestrict warning to detect more
than just trivial instances of overlapping copying
Ping #2:
https://gcc.gnu.org/ml/gcc-patches/2017-07/msg00411.html
On 07/08/2017 02:45 PM, Martin Sebor wrote:
PR 81117 asks for improved detection of common misuses(*) of
strncpy and strncat. The attached patch is my solution. It
consists of three related sets of changes:
1) Adds a new
I'm not sure why Solaris' decl of std::sprintf doesn't hit the
reject path above.
I was able to reproduce the behavior seen on Solaris on my Fedora
box by using this:
namespace std
{
extern int sprintf (char *dst, const char *format, ...);
}
This is how C library symbols were
I think this is great. My overall question is: is the new BLT
representation available in the middle-end? If not, do you
have plans to make it available? (I think it might be especially
useful there, to either accurately highlight the source of
a problem when it's far removed from the problem
On 07/24/2017 02:05 PM, David Malcolm wrote:
This patch extends the C frontend so that it optionally builds a BLT tree,
by using an auto_blt_node class within the recursive descent through the
parser, so that its ctor/dtors build the blt_node hierarchy; this is
rapidly (I hope) rejected in the
On 06/28/2017 11:41 AM, Joseph Myers wrote:
On Wed, 28 Jun 2017, Martin Sebor wrote:
I don't think there is an equivalent, dedicated trait in C++ to
do that either. One would have to be composed of the lower-level
ones. There also is no trait that would remove all type qualifiers
(including
On 06/29/2017 10:15 AM, Jan Hubicka wrote:
Hello,
diff --git a/gcc/hash-table.h b/gcc/hash-table.h
index 0f7e21a..443d16c 100644
--- a/gcc/hash-table.h
+++ b/gcc/hash-table.h
@@ -803,7 +803,10 @@ hash_table::empty_slow ()
m_size_prime_index = nindex;
}
else
On 06/29/2017 12:05 PM, Jeff Law wrote:
On 06/29/2017 11:57 AM, Jeff Law wrote:
On 05/23/2017 09:58 AM, Martin Sebor wrote:
On 05/18/2017 12:55 PM, Prathamesh Kulkarni wrote:
Hi,
The attached patch tries to fix PR80806 by warning when a variable is
set using memset (and friends) but not used
1001 - 1100 of 3995 matches
Mail list logo