Bug 165628 - fsck.cramfs.c:98: error: variable-size type declared outside of any function
Summary: fsck.cramfs.c:98: error: variable-size type declared outside of any function
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: util-linux
Version: rawhide
Hardware: i386
OS: Linux
medium
low
Target Milestone: ---
Assignee: Karel Zak
QA Contact: Ben Levenson
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2005-08-10 22:07 UTC by David Cantrell
Modified: 2007-11-30 22:11 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2005-08-15 12:03:41 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

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.


Note You need to log in before you can comment on or make changes to this bug.