Bug 214468 - sysutils/lxterminal return error in gmesssage.h
Summary: sysutils/lxterminal return error in gmesssage.h
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Olivier Duchateau
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-11-13 10:16 UTC by Walter Schwarzenfeld
Modified: 2016-11-20 10:56 UTC (History)
4 users (show)

See Also:


Attachments
svn_diff-sysutils_lxterminal (1.19 KB, patch)
2016-11-18 16:50 UTC, Walter Schwarzenfeld
no flags Details | Diff
patch-src_settings.c (1.19 KB, patch)
2016-11-19 04:56 UTC, Walter Schwarzenfeld
no flags Details | Diff
patch-src_settings.c (2.35 KB, text/x-csrc)
2016-11-19 05:00 UTC, Walter Schwarzenfeld
no flags Details
patch-src_settings.c (1.18 KB, text/x-csrc)
2016-11-19 06:40 UTC, Walter Schwarzenfeld
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Walter Schwarzenfeld freebsd_triage 2016-11-13 10:16:26 UTC
I tried to reinstall lxterminal.

It failed with:
setting.c:165:5: error: non-void function 'copy_setting' should return a value [-Wreturn-type]
    g_return_if_fail (setting != NULL);
    ^
/usr/local/include/glib-2.0/glib/gmessages.h:373:3: note: expanded from macro 'g_return_if_fail'
         return;                                                        \
         ^
1 error generated.

the error is in /usr/local/include/glib-2.0/glib/gmessages.h:
line 374
#define g_return_if_fail(expr)          G_STMT_START{                   \
     if G_LIKELY(expr) { } else                                         \
       {                                                                \
         g_return_if_fail_warning (G_LOG_DOMAIN,                        \
                                   G_STRFUNC,                           \
                                   #expr);                              \
=>         return;                                                        \
       };         

and the same in lin 392.

If I set return 1 I got a lot more errors.

So I deleted it. But this is surely wrong. g_return_if_fails must return something.
Comment 1 Walter Schwarzenfeld freebsd_triage 2016-11-13 17:50:27 UTC
Forgot:_
FreeBSD 10.3-RELEASE-p9 amd64.
Comment 2 Ting-Wei Lan 2016-11-18 15:12:33 UTC
Please move this bug to sysutils/lxterminal. This is not a bug of glib. It is a very common bug because old versions of gcc didn't report this kind of warning by default and old versions of glib headers had a pragma to suppress the gcc warning.

g_return_if_fail must not be used in a function that has a return value. g_return_val_if_fail should be used instead. This is already fixed by upstream: https://git.lxde.org/gitweb/?p=lxde/lxterminal.git;a=commitdiff;h=4cc47aa
Comment 3 Walter Schwarzenfeld freebsd_triage 2016-11-18 16:50:11 UTC
Created attachment 177146 [details]
svn_diff-sysutils_lxterminal
Comment 4 Walter Schwarzenfeld freebsd_triage 2016-11-18 16:51:11 UTC
Thanks!
---
I test it with poudriere tomorrow, now I have no time.
Comment 5 Walter Schwarzenfeld freebsd_triage 2016-11-18 17:13:27 UTC
Tests with poudrier 10.3amd64 and i386 ok.
Comment 6 Walter Schwarzenfeld freebsd_triage 2016-11-19 03:38:06 UTC
Poudriere tests on 93amd64 and i386 also ok.
Comment 7 Ting-Wei Lan 2016-11-19 03:57:29 UTC
Instead of commenting out 'USE_GCC= yes', you should simply delete the line.
Comment 8 Walter Schwarzenfeld freebsd_triage 2016-11-19 04:49:10 UTC
I took the upstream patch, and changed nothing, but I will delete the line, you are right.
Comment 9 Walter Schwarzenfeld freebsd_triage 2016-11-19 04:56:42 UTC
Created attachment 177169 [details]
patch-src_settings.c
Comment 10 Walter Schwarzenfeld freebsd_triage 2016-11-19 04:57:30 UTC
Sorry, was a misunderstood, had nothing to do with the patch, only with the Makefile.
Comment 11 Walter Schwarzenfeld freebsd_triage 2016-11-19 05:00:46 UTC
Created attachment 177170 [details]
patch-src_settings.c
Comment 12 Walter Schwarzenfeld freebsd_triage 2016-11-19 05:01:09 UTC
I attached the wrong file before.
Comment 13 Ting-Wei Lan 2016-11-19 06:07:52 UTC
Attachment 177170 [details] has duplicate diffs for both Makefile and files/.
Comment 14 Walter Schwarzenfeld freebsd_triage 2016-11-19 06:40:21 UTC
Created attachment 177172 [details]
patch-src_settings.c

sorry, should now correct.
Comment 15 Ting-Wei Lan 2016-11-19 15:00:24 UTC
Yes, it looks correct now.
Comment 16 commit-hook freebsd_committer freebsd_triage 2016-11-20 10:54:47 UTC
A commit references this bug:

Author: olivierd
Date: Sun Nov 20 10:54:07 UTC 2016
New revision: 426568
URL: https://svnweb.freebsd.org/changeset/ports/426568

Log:
  - Fix build with clang
  - Bump PORTREVISION

  PR:		214468
  Submitted by:	<w.schwarzenfeld@utanet.at>
  Reviewed by:	Ting-Wei Lan
  Obtained from:	Upstream repository

Changes:
  head/sysutils/lxterminal/Makefile
  head/sysutils/lxterminal/files/
  head/sysutils/lxterminal/files/patch-src_setting.c
Comment 17 Olivier Duchateau freebsd_committer freebsd_triage 2016-11-20 10:56:40 UTC
Committed, thanks!