[Geany-devel] msgwin line and column position

Dimitar Zhekov dimitar.zhekov at xxxxx
Thu Aug 18 17:28:33 UTC 2011

On Thu, 18 Aug 2011 12:28:01 +1000
Lex Trotman <elextr at gmail.com> wrote:

> >> pmatch[2] = pmatch[3];

> Well you obviously get away with it because it isn't really opaque (to
> the compiler), but it is still bad practice to assign such structures
> unless it is documented safe.

Instead of attempting to imagine how a swallow copy may go wrong, I
decided to just assign the two members. libc _can't_ access them for
it's own purposes, because it doesn't know the lifetime of pmatch.

> Technically (gint)l == l is using implementation defined behavior, the
> standard says that the converting to a shorter signed type should give
> the same value if it fits, but if it doesn't fit, its implementation
> defined.

Yes, if 'l' becomes unsigned long, such a check will be unreliable...

> then the comparison to G_MAXINT is a correct way of doing it.

...which always works, so let's play it safe again. Thanks.

E-gards: Jimmy
-------------- next part --------------
A non-text attachment was scrubbed...
Name: compiler-line-column-b-5887.diff
Type: text/x-diff
Size: 13166 bytes
Desc: not available
URL: <http://lists.geany.org/pipermail/devel/attachments/20110818/90cba1aa/attachment.diff>

More information about the Devel mailing list