[Edk2 Dev] ANSI C and PCD?

Subject: [Edk2 Dev] ANSI C and PCD?

From: "Andrew J. Fish" <afish@apple.com>

To: dev@edk2.tianocore.org

Date: 2008-08-21 21:51:20

I'm getting the following error out of gcc

DEBUG/AutoGen.c:42: warning: this decimal constant is unsigned only in  
ISO C90

GLOBAL_REMOVE_IF_UNREFERENCED const UINT32  
_gPcd_FixedAtBuild_PcdPrePiBfvBaseAddress =  
_PCD_VALUE_PcdPrePiBfvBaseAddress;

with the autogen.h defining:
#define _PCD_VALUE_PcdPrePiBfvBaseAddress  4294901760

It looks like the compiler is complaining about having an integer that  
is too big.

In GenC.py I changed:

             AutoGenH.Append('#define %s  %s\n' %(PcdValueName, Value))

To:
             if Pcd.DatumType == 'UINT32':
               AutoGenH.Append('#define %s  %sUL\n' %(PcdValueName,  
Value))
             else:
               AutoGenH.Append('#define %s  %s\n' %(PcdValueName,  
Value))

And
This fixes the problem, but I'm not very good with Python so I'm not  
sure if this is the best solution.

Andrew Fish

------------------------------------------------------
https://edk2.tianocore.org/ds/viewMessage.do?dsForumId=135&dsMessageId=28571

To unsubscribe from this discussion, e-mail: [dev-unsubscribe@edk2.tianocore.org].