RPM Community Forums

Mailing List Message of <rpm-devel>

Re: [CVS] RPM: rpm/rpmio/ argv.h

From: Arkadiusz Miskiewicz <arekm@rpm5.org>
Date: Wed 30 Jul 2008 - 12:21:27 CEST
Message-Id: <200807301221.27722.arekm@rpm5.org>
On Wednesday 30 July 2008, Jeff Johnson wrote:
> On Jul 30, 2008, at 5:50 AM, Ralf S. Engelschall wrote:
> > On Wed, Jul 30, 2008, Jeff Johnson wrote:
> >> This "band-aid" prevents installing argv.h in /usr/include/rpm w/o
> >> messy
> >> AutoFu.
> >
> > Really? If no Autoconf #defines are present, _nothing_ happens. The
> > stuff degrades gracefully to just no #include at all. So, this should
> > not cause any problems.
>
> And the degradation was the problem that arekm set out to solve.

The problem is that public rpm headers are not self contained. They use stuff like
different types but don't include required headers. Example:

[arekm@carme-pld ~]$ cat a.c
#include <rpm/rpmlib.h>
int main() {return 0;}
[arekm@carme-pld ~]$ gcc a.c -I/usr/include/rpm
In file included from /usr/include/rpm/rpmtag.h:8,
                 from /usr/include/rpm/rpmlib.h:11,
                 from a.c:1:
/usr/include/rpm/rpmsw.h:24: error: field ‘tv’ has incomplete type
/usr/include/rpm/rpmsw.h:36: error: expected specifier-qualifier-list before ‘size_t’
/usr/include/rpm/rpmsw.h:111: error: expected declaration specifiers or ‘...’ before ‘ssize_t’
/usr/include/rpm/rpmsw.h:121: error: expected declaration specifiers or ‘...’ before ‘ssize_t’
In file included from /usr/include/rpm/rpmtag.h:9,
                 from /usr/include/rpm/rpmlib.h:11,
                 from a.c:1:
/usr/include/rpm/stringbuf.h:52: error: expected declaration specifiers or ‘...’ before ‘size_t’
In file included from /usr/include/rpm/rpmlib.h:11,
                 from a.c:1:
/usr/include/rpm/rpmtag.h:54: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘rpmTagCount’
/usr/include/rpm/rpmtag.h:67: error: expected specifier-qualifier-list before ‘uint8_t’
/usr/include/rpm/rpmtag.h:468: error: expected specifier-qualifier-list before ‘rpmTagCount’
/usr/include/rpm/rpmtag.h:629: error: expected declaration specifiers or ‘...’ before ‘size_t’
/usr/include/rpm/rpmtag.h:700: error: expected ‘)’ before ‘*’ token
/usr/include/rpm/rpmtag.h:838: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘headerSizeof’
/usr/include/rpm/rpmtag.h:848: error: expected declaration specifiers or ‘...’ before ‘size_t’
/usr/include/rpm/rpmtag.h:939: error: expected declaration specifiers or ‘...’ before ‘size_t’
/usr/include/rpm/rpmtag.h:949: error: expected declaration specifiers or ‘...’ before ‘size_t’
/usr/include/rpm/rpmtag.h:1028: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘headerGetInstance’
/usr/include/rpm/rpmtag.h:1037: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘headerSetInstance’
/usr/include/rpm/rpmtag.h:1045: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘headerGetStartOff’
/usr/include/rpm/rpmtag.h:1054: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘headerSetStartOff’
/usr/include/rpm/rpmtag.h:1062: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘headerGetEndOff’
/usr/include/rpm/rpmtag.h:1071: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘headerSetEndOff’
/usr/include/rpm/rpmtag.h:1125: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘hGetColor’
In file included from /usr/include/rpm/rpmlib.h:12,
                 from a.c:1:
/usr/include/rpm/rpmversion.h:61: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘rpmlibVersion’
/usr/include/rpm/rpmversion.h:63: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘rpmlibTimestamp’
/usr/include/rpm/rpmversion.h:65: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘rpmlibVendor’
zsh: exit 1     gcc a.c -I/usr/include/rpm


Try to do the same with for example glibc headers. These are well written and self-consistent.

> The AutoFu imposes conventions on using rpm include files.
>
> Imposing conventions is no different than asking applications to do
>      #include <stdint.h>
> or whatever else is necessary to supply typedefs.



> 73 de Jeff

-- 
Arkadiusz Miśkiewicz        PLD/Linux Team
arekm / maven.pl            http://ftp.pld-linux.org/
Received on Wed Jul 30 12:21:30 2008
Driven by Jeff Johnson and the RPM project team.
Hosted by OpenPKG and Ralf S. Engelschall.
Powered by FreeBSD and OpenPKG.