Bug 165628

Summary: fsck.cramfs.c:98: error: variable-size type declared outside of any function
Product: [Fedora] Fedora Reporter: David Cantrell <dcantrell>
Component: util-linuxAssignee: Karel Zak <kzak>
Status: CLOSED NOTABUG QA Contact: Ben Levenson <benl>
Severity: low Docs Contact:
Priority: medium    
Version: rawhide   
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2005-08-15 12:03:41 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 David Cantrell 2005-08-10 22:07:22 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.8) Gecko/20050705

Description of problem:
If building util-linux-2.12p-10 with gcc-3.4.4 on i386, you get this error:

fsck.cramfs.c:98: error: variable-size type declared outside of any function

The simple fix to to patch disk-utils/fsck.cramfs.c by changing line 81 from:

#define PAGE_CACHE_SIZE ((int) PAGE_SIZE)

To:

#define PAGE_CACHE_SIZE (sizeof((int) PAGE_SIZE))

Version-Release number of selected component (if applicable):
util-linux-2.12p-10

How reproducible:
Always

Steps to Reproduce:
1. Ensure you have gcc-3.4.x.
2. Get the source RPM.
3. Rebuild it.
4. See error.
  

Actual Results:  This isn't a problem with the binary package, but rather a patch to make it compile correctly.

Expected Results:  Uhh, to be able to compile the source.

Additional info:

Comment 1 Karel Zak 2005-08-11 07:16:55 UTC
Thanks for report, but sizeof() is bad idea -- it returns size of object in
memory. It means 4 bytes (for 32bit int) -- original macro is >=4096.

Comment 2 Karel Zak 2005-08-11 08:00:03 UTC
BTW, I cannot reproduce it with gcc 4.0 or 3.2. You report is for devel branch,
but there's gcc4. We have gcc 3.4 in FC3, but there's different code in
fsck.cramfs.c.

Comment 3 David Cantrell 2005-08-11 13:50:47 UTC
Just built with gcc 4.x and it's fine.  Disregard my report.  Gcc major version
changes can be annoying.

And yeah, I know what sizeof() does.  One of those stupid brain misfunction
incidents.

Thanks and sorry to waste your time.