Skip to main content

IAR Embedded Workbench for Arm 9.70.x

__no_alloc_str, __no_alloc_str16

このセクションの内容:
構文
__no_alloc_str(string_literal @ section)

を返し、また

__no_alloc_str16(string_literal @ section)

説明:

string_literal

実行ファイルで使用可能にする文字列リテラル。

section

文字列リテラルを配置するセクション名。

説明

定数で __no_alloc_str または __no_alloc_str16演算子を使用すると、リンクされたアプリケーション内でスペースをとることなく、実行ファイルで文字列リテラルが使用可能になります。

この式の値は、セクション内の文字列リテラルのオフセットです。__no_alloc_strの場合、オフセットの型はunsigned longです。__no_alloc_str16の場合、オフセットの型はunsigned shortです。

#define MYSEG "YYY"
#define X(str) __no_alloc_str(str @ MYSEG)

extern void dbg_printf(unsigned long fmt, ...)

#define DBGPRINTF(fmt, ...) dbg_printf(X(fmt), __VA_ARGS__)

void
foo(int i, double d)
{
  DBGPRINTF("The value of i is: %d, the value of d is: %f",i,d);
}

使用するデバッガとランタイムサポートによっては、これによってホストコンピュータ上でトレース出力が生成することができます。

注記

外部のプラグインモジュールを使用しない限り、C-SPYではこうしたランタイムサポートはありません。

関連項目

__no_alloc, __no_alloc16.