Re: [C PATCH] Fix up diagnostics (PR c/25801)

2014-05-02 Thread Marek Polacek
On Thu, May 01, 2014 at 10:54:18PM +, Joseph S. Myers wrote: I think the comment on this function should be updated to explain the interface contract when an incomplete (or function) type is passed (i.e. return size_one_node, caller is responsible for any diagnostics). Done. The test

Re: [C PATCH] Fix up diagnostics (PR c/25801)

2014-05-02 Thread Joseph S. Myers
On Fri, 2 May 2014, Marek Polacek wrote: On Thu, May 01, 2014 at 10:54:18PM +, Joseph S. Myers wrote: I think the comment on this function should be updated to explain the interface contract when an incomplete (or function) type is passed (i.e. return size_one_node, caller is

Re: [C PATCH] Fix up diagnostics (PR c/25801)

2014-05-01 Thread Joseph S. Myers
On Fri, 18 Apr 2014, Marek Polacek wrote: @@ -1760,15 +1760,10 @@ c_size_in_bytes (const_tree type) I think the comment on this function should be updated to explain the interface contract when an incomplete (or function) type is passed (i.e. return size_one_node, caller is responsible for

[C PATCH] Fix up diagnostics (PR c/25801)

2014-04-18 Thread Marek Polacek
Here's a patch that tidies up diagnostics given when there's an arithmetic on pointer to an incomplete type. Firstly, we ought not to say unknown structure when the type is not a structure; secondly, we shouldn't report identical error twice. (It might make sense to instead increment/decrement of