Skip to content
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

export "something" { } wrong parsing #8838

Closed
FoxOneReal opened this issue Oct 20, 2021 · 8 comments
Closed

export "something" { } wrong parsing #8838

FoxOneReal opened this issue Oct 20, 2021 · 8 comments
Labels
C/C++ enhancement a request to enhance doxygen, not a bug

Comments

@FoxOneReal
Copy link

Describe the bug
I have something like this

extern "OldAsmCall" {
	void func1();
	void func2();
}

in my sources (old VDSP compiler). Doxygen parse this as extern variable OldAsmCall with intializer { void func1() and normal function void func2()

extern "C" { } or "C++" do parsed normally

Expected behavior
Expected to see extern void func1() and extern void func2()

Screenshots
screenshot

Version
Tested 1.9.2

@albert-github
Copy link
Collaborator

Is the VDSP the VisualDSP compiler from Analogous Devices (which version) or is it another compiler?

Is the meaning of extern "OldAsmCall" { similar to extern "C" {?
Doxygen only supports extern "C" and extern "C++" and in the C / C++ standard I did not find any reference to OldAsmCall and doxygen doesn't understand it.
In the manual from mentioned compiler I could not find a reference to this type of construct though.

Best way to go is to write a small filter, see FILTER_PATTERNS and INPUT_FILTER (a filter like INPUT_FILTER = "sed -e 's/extern *\"OldAsmCall\"/extern \"C\"/'" would probably be sufficient).

@albert-github albert-github added C/C++ Usage The mentioned problem is not a doxygen problem but due to usage of a feature. labels Oct 21, 2021
@FoxOneReal
Copy link
Author

FoxOneReal commented Oct 22, 2021

You are right! It is VisualDSP++ compiler from Analog Devices. And there is extern OldAsmCall in documentation (C Compiler And Library Manual for ADSP-218x DSPs section Legacy Support page C-3, 1-157 also and more)

extern string-literal declaration where string-literal - The name of the required language linkage. The standard guarantes only two language linkages to be supported: "C" and "C++" I mean it does not restrict existing of some other language linkage But I thought Doxygen ignores language linkage at all. It's useless for Doxygen. I was pretty surprised it was parsed as a variable declaration

I've got your idea to use INPUT_FILTER. Thanks! Sadly, there is no sed on windows system. And I don't understand how FILTER_PATTERNS may help.

@albert-github
Copy link
Collaborator

albert-github commented Oct 22, 2021

The FILTER_PATTERN is similar to INPUT_FILTER though it just operates on files with a specific extension, the INPUT_FILTER operates on all other files.
For sed there are some alternatives on windows:

  • install (part of) Cygwin, probably a bit of an overkill
  • install, part of , the GNU tools for windows, search for gnu sed windows
  • search the web for sed replacement windows to get some ideas
  • write your own filter in your preferred language (C / C++, Python, perl, ...)

@FoxOneReal
Copy link
Author

Anyway INPUT_FILTER is workaround. Is such behavior a doxygen bug? or clang bug? or something else?

@albert-github albert-github added enhancement a request to enhance doxygen, not a bug and removed Usage The mentioned problem is not a doxygen problem but due to usage of a feature. labels Oct 22, 2021
@albert-github
Copy link
Collaborator

albert-github commented Oct 22, 2021

I see extern "OldAsmCall" as not strict standard C / C++ and in the manual you quoted it is under "Legacy Support".

I looked (again) in the C++ standard (after rereading your comment: "extern string-literal declaration where string-literal - The name of the required language linkage. The standard guarantes only two language linkages to be supported: "C" and "C++" I mean it does not restrict existing of some other language linkage ") and see in paragraph 9.11 Linkage Specification:

Linkage (6.6) between C++ and non-C++ code fragments can be achieved using a linkage-specification:
    linkage-specification:
        extern string-literal { declaration-seqopt }
        extern string-literal declaration
The string-literal indicates the required language linkage. This document specifies the semantics for the
string-literals "C" and "C++". Use of a string-literal other than "C" or "C++" is conditionally-supported, with
implementation-defined semantics.

So it indeed looks like "OldAsmCall" should be supported.

albert-github added a commit to albert-github/doxygen that referenced this issue Oct 22, 2021
According to the C++ standard "C" and "C++" have to be supported and other linkage types: "Use of a string-literal other than "C" or "C++" is conditionally-supported, with implementation-defined semantics."
@albert-github
Copy link
Collaborator

albert-github commented Oct 22, 2021

I've just pushed a proposed patch, pull request #8842

doxygen added a commit that referenced this issue Oct 23, 2021
issue #8838 export "something" { } wrong parsing
@albert-github albert-github added the fixed but not released Bug is fixed in github, but still needs to make its way to an official release label Oct 23, 2021
@albert-github
Copy link
Collaborator

Code has been integrated in master on GitHub (please don't close the issue as this will be done at the moment of an official release).

@doxygen
Copy link
Owner

doxygen commented Dec 31, 2021

This issue was previously marked 'fixed but not released',
which means it should be fixed in doxygen version 1.9.3.
Please verify if this is indeed the case. Reopen the
issue if you think it is not fixed and please include any additional information
that you think can be relevant (preferably in the form of a self-contained example).

@doxygen doxygen removed the fixed but not released Bug is fixed in github, but still needs to make its way to an official release label Dec 31, 2021
@doxygen doxygen closed this as completed Dec 31, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C/C++ enhancement a request to enhance doxygen, not a bug
Projects
None yet
Development

No branches or pull requests

3 participants