New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EXTENSION_MAPPING not working when redefining default extensions (Origin: bugzilla #626033) #3890

doxygen opened this Issue Jul 2, 2018 · 0 comments


None yet
1 participant

doxygen commented Jul 2, 2018

status RESOLVED severity normal in component general for ---
Reported in version 1.7.1 on platform Other
Assigned to: Dimitri van Heesch

On 2010-08-04 15:44:29 +0000, Fabrice GUY wrote:

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 :

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.

On 2010-08-19 19:10:41 +0000, Dimitri van Heesch wrote:

That's the same issue indeed.

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

@doxygen doxygen closed this Jul 2, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment