Bug 14995 - jffs2.h does not compile in C++ mode
Summary: jffs2.h does not compile in C++ mode
Status: CLOSED WILL_NOT_FIX
Alias: None
Product: File System
Classification: Unclassified
Component: Other (show other bugs)
Hardware: All Linux
: P1 low
Assignee: fs_other
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-01-06 10:45 UTC by R. Diez
Modified: 2010-02-09 16:25 UTC (History)
3 users (show)

See Also:
Kernel Version:
Subsystem:
Regression: No
Bisected commit-id:


Attachments

Description R. Diez 2010-01-06 10:45:12 UTC
If I #include file jffs2.h from a .cpp (C++) file, I get a compilation error. The reason is that union jffs2_device_node has a "jint32_t new" field, but "new" is a reserved keyword in C++. Could you please rename that field?
Comment 1 David Woodhouse 2010-01-06 11:11:13 UTC
I suppose we could.... do I want to know why you're including jffs2.h from a C++ file? It's only really exported to userspace for the benefit of mtd-utils.
Comment 2 Stefan Opfermann 2010-01-06 16:41:08 UTC
(In reply to comment #1)
> I suppose we could.... do I want to know why you're including jffs2.h from a
> C++ file? It's only really exported to userspace for the benefit of
> mtd-utils.

Unfortunately mtd-utils is only a collection of executables and not a library for providing a API for user space access, e.g. from a C++ program.

JFFS2 must be pointed to an erased Flash area.

For handling and checking this case, we are missing some structures and defines within mtd-abi.h, so we are also including jffs2.h from a C++ file.

For the first, it would be very helpfully if you rename the "jint32_t new".

The ideal solution would be to provide a interface or function within "mtd-user.h" to check for a valid JFFS2 partition before the decision
for erasing the flash sectors.

Thank you in advance
Comment 3 Alan 2010-02-09 16:25:18 UTC
Changing the field names would break the API and existing users

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