Bug 193964 - devel/gperf enhancements from Apple
Summary: devel/gperf enhancements from Apple
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: Dirk Meyer
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-09-27 04:18 UTC by Pedro F. Giffuni
Modified: 2016-11-27 19:28 UTC (History)
0 users

See Also:
dinoex: maintainer-feedback+


Attachments
Add Apple's gperf enhancements (13.10 KB, patch)
2014-09-27 04:18 UTC, Pedro F. Giffuni
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Pedro F. Giffuni freebsd_committer freebsd_triage 2014-09-27 04:18:11 UTC
Created attachment 147710 [details]
Add Apple's gperf enhancements

There are a couple of enhancements under the GPLv2 available on Apple's site:

http://opensource.apple.com/source/gperf/gperf-9/patches/

This may be useful as they took our libc and we took their compilers ;).
At least the offsetof patch is applied in our src tree (the size_type patch was there too but it introduced a warning) but gperf is likely to disappear from base soon.

We pass the new tests.
Comment 1 Bugzilla Automation freebsd_committer freebsd_triage 2014-09-27 04:18:11 UTC
Auto-assigned to maintainer dinoex@FreeBSD.org
Comment 2 Dirk Meyer freebsd_committer freebsd_triage 2014-09-27 10:24:08 UTC
Please specifiy the LICENSE of this patch ....
DO you haver any source URL?
Comment 3 Pedro F. Giffuni freebsd_committer freebsd_triage 2014-09-27 12:36:00 UTC
(In reply to Dirk Meyer from comment #2)
> Please specifiy the LICENSE of this patch ....
> DO you have any source URL?

Yes, this is Apple's gperf distribution and they use GPLv2

look one step up in the directory where the patches are:
http://opensource.apple.com/source/gperf/gperf-9/

COPYING:
                    GNU GENERAL PUBLIC LICENSE
                       Version 2, June 1991
...

___

(AFAICT Apple doesn't ship any code under GPLv3.)
Comment 4 Dirk Meyer freebsd_committer freebsd_triage 2014-10-15 18:50:15 UTC
with patches allpied, I get a few more warnings nows:

< ./output.cc:1304:22: warning: format specifies type 'int' but the argument has type 'long' [-Wformat]
---
> ./output.cc:782:11: warning: format string is empty [-Wformat-zero-length]
>           "", option.get_size_type());
>           ^~
> ./output.cc:1302:22: warning: format specifies type 'int' but the argument has type 'long' [-Wformat]
178c182,185
< 1 warning generated.
---
> ./output.cc:1910:11: warning: format string is empty [-Wformat-zero-length]
>           "", option.get_size_type());
>           ^~
> 3 warnings generated.

it looks not right to call:
    printf ( "", option.get_size_type());
Comment 5 Pedro F. Giffuni freebsd_committer freebsd_triage 2014-10-15 22:38:33 UTC
(In reply to Dirk Meyer from comment #4)
> with patches allpied, I get a few more warnings nows:
> 
> < ./output.cc:1304:22: warning: format specifies type 'int' but the argument
> has type 'long' [-Wformat]
> ---
> > ./output.cc:782:11: warning: format string is empty [-Wformat-zero-length]
> >           "", option.get_size_type());
> >           ^~
> > ./output.cc:1302:22: warning: format specifies type 'int' but the argument has type 'long' [-Wformat]
> 178c182,185
> < 1 warning generated.
> ---
> > ./output.cc:1910:11: warning: format string is empty [-Wformat-zero-length]
> >           "", option.get_size_type());
> >           ^~
> > 3 warnings generated.
> 
> it looks not right to call:
>     printf ( "", option.get_size_type());

Known non-issue:

https://lists.freebsd.org/pipermail/svn-src-head/2013-November/053509.html

The compiler is clueless, if not buggy.
You can either ignore it (-Wno-format-zero-length) or just don't apply 
patch-size_type
Comment 6 commit-hook freebsd_committer freebsd_triage 2014-10-19 11:24:04 UTC
A commit references this bug:

Author: dinoex
Date: Sun Oct 19 11:23:48 UTC 2014
New revision: 371177
URL: https://svnweb.freebsd.org/changeset/ports/371177

Log:
  - Add Apple's gperf enhancements (GPLv2)
  PR:		193964
  Submitted by:	Pedro F. Giffuni
  Obtained from:	http://opensource.apple.com/source/gperf/gperf-9/patches/

Changes:
  head/devel/gperf/Makefile
  head/devel/gperf/files/
  head/devel/gperf/files/patch-offsetof
  head/devel/gperf/files/patch-size_type
Comment 7 Dirk Meyer freebsd_committer freebsd_triage 2014-10-19 11:24:53 UTC
Thanks for the clarification.

I added both patches with minor cleanups.
Comment 8 Pedro F. Giffuni freebsd_committer freebsd_triage 2016-11-27 19:28:52 UTC
For historic purposes, and because there is no other place where it would be relevant, upstream gperf has alternative fixes (GPLv3) for the same issues:

http://lists.gnu.org/archive/html/bug-gperf/2016-11/msg00009.html