Codegen of header comments

Is there a way for codegen to not generate the date in the header comment. In other words omit the line "C source code generated on: xxxx:" if that is not possible is it possible to not generate any header comments? I still want the comments in the code just not the header stuff.

댓글 수: 6

Kaustubha Govind
Kaustubha Govind 2013년 1월 17일
Which product are you using for code generation? MATLAB Coder or Simulink Coder?
Y
Y 2013년 1월 17일
Matlab Coder
Walter Roberson
Walter Roberson 2013년 1월 21일
I am wondering why you want this? If it is a matter of wanting to be able to compare generated code, then comparison tools can often be configured to ignore something like this. Also there are tools available that could post-process the code to remove the line.
Y
Y 2013년 1월 21일
편집: Y 2013년 1월 21일
It messes up source control because every file ends up being modified due to the date change even though there is no real change to file. So you can't tell what was a real change and what was not.
You are correct I could post process and remove that line, but that seems silly. I should just be able to tell it to not generate the date.
Y
Y 2013년 1월 28일
no one knows?
Kaustubha Govind
Kaustubha Govind 2013년 2월 1일
Y: I don't know the answer for MATLAB Coder (I know how you would do it using Simulink Coder). Could you check with MathWorks Tech Support about this and put in an enhancement request if the functionality doesn't exist?

댓글을 달려면 로그인하십시오.

답변 (1개)

Akshat Dalal
Akshat Dalal 2025년 2월 26일

0 개 추천

Hi
You can modify the default code generation template. It has a <SourceGeneratedOn> token which generates the date. Please refer the following documentation for more information: https://www.mathworks.com/help/ecoder/ug/generate-custom-file-and-function-banners-for-matlab-code-generation.html
Hope this helps.

카테고리

도움말 센터File Exchange에서 Simulink Coder에 대해 자세히 알아보기

제품

질문:

Y
Y
2013년 1월 17일

답변:

2025년 2월 26일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by