After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 626033 - EXTENSION_MAPPING not working when redefining default extensions
EXTENSION_MAPPING not working when redefining default extensions
Status: RESOLVED DUPLICATE of bug 567774
Product: doxygen
Classification: Other
Component: general
1.7.1
Other Windows
: Normal normal
: ---
Assigned To: Dimitri van Heesch
Dimitri van Heesch
Depends on:
Blocks:
 
 
Reported: 2010-08-04 15:44 UTC by Fabrice GUY
Modified: 2010-08-19 19:10 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Fabrice GUY 2010-08-04 15:44:29 UTC
I have developped a perl script which transforms .m (Matlab files) into .cpp files.
I have then defined the EXTENSION_MAPPING (in the Doxyfile) as described in the documentation, that is :
EXTENSION_MAPPING=m=C++

Unfortunately, this syntax was not working.

Looking into the code, I discover that .m files are associated with objective-c language (see the file util.cpp, line 6484 in the initDefaultExtensionMapping function) :
updateLanguageMapping(".m",     "objective-c");

If the EXTENSION_MAPPING is redefined, the updateLanguageMapping function is called but without the dot in the extension (see the file doxygen.cpp, line 9560). Setting EXTENSION_MAPPING to m=C++ leads to :
updateLanguageMapping("m", "C++") (note the missing dot in the "m")

The preceding association between .m file and objective-c won't be replaced by the new one as expected, because extension .m and m are not considered to be the same extension : the map g_extLookup (see function updateLanguageMapping in file util.cpp) will contain for m files :
{
...
{'.m', SrcLangExt_ObjC},
{'m', SrcLangExt_Cpp}
...
}

And following calls to getLanguageFromFileName will still lead to associate .m files with Objective-C.

As a workaround, we can modify the EXTENSION_MAPPING that way :
EXTENSION_MAPPING=.m=C++ (note the dot before the 'm')

Doxygen behaves then as expected but :
- this is not correct regarding to the documentation
- Doxygen outputs : "Adding custom extension mapping: ..m will be treated as language c++" (note the two dots before the 'm')

See also bug #567774 describing a similar problem.
Comment 1 Dimitri van Heesch 2010-08-19 19:10:41 UTC
That's the same issue indeed.

*** This bug has been marked as a duplicate of bug 567774 ***