Jump to content

Tenary Opperator Assignment To Global Boolean Vars


Guest Joe

Recommended Posts

OK, straight into the code:

 

#include <system.h>

bool apples = 0;

void foo()
{
   unsigned char bitfield = 0xa5;
   apples = (bitfield & 0x10) ? 1 : 0;
}

void main()
{
   foo();
}

 

I get a weird and unexpected warning:

 

Compiling...

 

"C:\Program Files\SourceBoost\boostc.pic16.exe" -t PIC16F873  dddddddd.c

 

BoostC Optimizing C Compiler Version 2.0.1 Beta (for PIC16 architecture)

http://www.picant.com/c2c/c.html

Copyright© 2004-2005 Pavel Baranov

Copyright© 2004-2005 David Hobday

 

 

dddddddd.c(9:29): warning: local variable '' may be used uninitialized

success

Done

 

 

any ideas why this is? the code is fine.

Link to post
Share on other sites

Join the conversation

You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...