RPM Community Forums

Mailing List Message of <rpm-devel>

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

From: Jeff Johnson <n3npq@mac.com>
Date: Wed 30 Jul 2008 - 12:31:18 CEST
Message-id: <523D8AB5-744B-406A-8B0A-79833DB25675@mac.com>

On Jul 30, 2008, at 6:21 AM, Arkadiusz Miskiewicz wrote:

> 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:
>

And rpm has never __EVER__ promised that each and every include file is
self contained.

Nor is there any need for the files to be self contained.

Yes I know what you want ...

> [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
     #include <rpmcli.h>

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

rpm != glibc

73 de Jeff
Received on Wed Jul 30 12:31:32 2008
Driven by Jeff Johnson and the RPM project team.
Hosted by OpenPKG and Ralf S. Engelschall.
Powered by FreeBSD and OpenPKG.