MATLAB Answers

Why is the preprocessor check #if ( UCHAR_MAX != (0xFFU) ) || ( SCHAR_MAX != (0x7F) ) being generated in private.h?

이 질문에 1명의 참여자가 플래그를 지정함
In the generated code for my model, I have noticed that the following code is generated in the "model_private.h" file:
#if ( UCHAR_MAX != (0xFFU) ) ( SCHAR_MAX != (0x7F) )
#error Code was generated for compiler with different sized uchar/char. \
Consider adjusting Test hardware word size settings on the \
Hardware Implementation pane to match your compiler word sizes as \
defined in limits.h of the compiler. Alternatively, you can \
select the Test hardware is the same as production hardware option and \
select the Enable portable word sizes option on the Code Generation > \
Verification pane for ERT based targets, which will disable the \
preprocessor word size checks.
#endif
Why is this code being generated?

태그

아직 태그를 입력하지 않았습니다.

제품


릴리스

R2013b

답변 수: 2

Answer by MathWorks Support Team on 25 Apr 2019
 Accepted Answer

The above code is being generated because a signal or block with a fixed point data type is being used in your model. Please refer to the link for more details.

  댓글 수: 0

로그인 to comment.


Answer by Mayur Sathawane on 22 May 2019

Change below porperty in model configuration,
'ERTFilePackagingFormat' to 'Modular', (Code Generation --> Code Placement --> Code Packaging)
This will include model_private.h in code instead.

  댓글 수: 0

로그인 to comment.



Translated by