Bug 112448

Summary: Headers are broken for C++
Product: [Retired] Red Hat Raw Hide Reporter: Enrico Scholz <rh-bugzilla>
Component: e2fsprogsAssignee: Thomas Woerner <twoerner>
Status: CLOSED RAWHIDE QA Contact: David Lawrence <dkl>
Severity: medium Docs Contact:
Priority: medium    
Version: 1.0   
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2004-02-05 16:02:44 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Enrico Scholz 2003-12-19 20:42:46 UTC
Description of problem:

| $ cat /tmp/foo.c
| #include <ext2fs/ext2fs.h>
| 
| $ gcc -c /tmp/foo.c
| $ g++ -c /tmp/foo.c
| In file included from /tmp/foo.c:1:
| /usr/include/ext2fs/ext2fs.h:980: error: syntax error before `__attribute__'
| /usr/include/ext2fs/ext2fs.h: In function `errcode_t ext2fs_resize_mem(...)':
| /usr/include/ext2fs/ext2fs.h:980: error: declaration of C function `errcode_t 
|    ext2fs_resize_mem(...)' conflicts with
| /usr/include/ext2fs/ext2fs.h:918: error: previous declaration `errcode_t 
|    ext2fs_resize_mem(long unsigned int, long unsigned int, void*)' here
| /usr/include/ext2fs/ext2fs.h: In function `errcode_t ext2fs_resize_mem(...)':
| /usr/include/ext2fs/ext2fs.h:984: error: `ptr' undeclared (first use this 


This is because of the line

| _INLINE_ errcode_t ext2fs_resize_mem(unsigned long old_size EXT2FS_ATTR((unused)),

Moving the EXT2FS_ATTR _before_ 'old_size' makes it work like a charm.


Version-Release number of selected component (if applicable):

e2fsprogs-devel-1.35-3
gcc-c++-3.3.2-3


How reproducible:

100%


Additional info:

I am reporting it here, since 1.35 is an unofficial version and I can
not check if it is fixed in CVS/BK already.

Comment 1 Enrico Scholz 2004-01-10 06:44:23 UTC
Since people are asking what I mean with the moving of EXT2FS_ATTR,
here a patch-like notation:

- _INLINE_ errcode_t ext2fs_resize_mem(unsigned long old_size EXT2FS_ATTR((unused)),
+ _INLINE_ errcode_t ext2fs_resize_mem(unsigned long EXT2FS_ATTR((unused)) old_size,



Btw, problem still exists in e2fsprogs-1.35-4


Comment 2 Thomas Woerner 2004-02-05 16:02:44 UTC
Fixed in rawhide in rpm e2fsprogs-1.35-5.1 or newer.