Bug 14995

Summary: jffs2.h does not compile in C++ mode
Product: File System Reporter: R. Diez (rdiezmail-kernelbugzilla)
Component: OtherAssignee: fs_other
Status: CLOSED WILL_NOT_FIX    
Severity: low CC: alan, dwmw2, st.opfermann
Priority: P1    
Hardware: All   
OS: Linux   
Kernel Version: Subsystem:
Regression: No Bisected commit-id:

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