ARM Technical Support Knowledge Articles

USING SOF FOR PEC IN EMBEDDED C++

Applies to: C166 C Compiler

Answer


Information in this article applies to:


QUESTION

While using the Embedded C++ compiler, if I initialize a PEC pointer using the _sof_ intrinsic function, I get the following error and warning messages:

unsigned int sdata samples[70];

 SRCP0 = (unsigned int)&ADC_DAT;
   warning 174: conversion from pointer to smaller integer
   warning 174: integer conversion resulted in truncation
 DSTP0 = _sof_(samples);
   error 176: argument of type "unsigned int sdata
              *" is incompatible with parameter of type "void huge *"

Is there a way to remove these error and warning messages?

ANSWER

Yes, you may use type casts as shown below:

  SRCP0 = _sof_ ((void huge *) &ADC_DAT);
  DSTP0 = _sof_ ((void huge *) samples);

MORE INFORMATION

Article last edited on: 2007-01-11 10:02:33

Rate this article

[Bad]
|
|
[Good]
Disagree? Move your mouse over the bar and click

Did you find this article helpful? Yes No

How can we improve this article?

Link to this article
Copyright © 2011 ARM Limited. All rights reserved. External (Open), Non-Confidential