Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.arch.embedded > #24994

Re: XC8 novice question

From Hans-Bernhard Bröker <HBBroeker@t-online.de>
Newsgroups comp.arch.embedded
Subject Re: XC8 novice question
Date 2016-09-11 13:42 +0200
Message-ID <e3kuaaF3144U1@mid.dfncis.de> (permalink)
References <wbGdnWYUU7sHnEjKnZ2dnUU7-KvNnZ2d@westnet.com.au>

Show all headers | View raw


Am 11.09.2016 um 09:02 schrieb rwood:

> If i define my_variable using;
>
> #define my_variable 0b10000000

That's a blatant misnomer, because that's not at all a variable.
It's a constant-valued macro.  The distinction is important, so maybe 
you should go back to your training materials to learn more.

> I get a compiler warning;
>
> warning: (752) conversion to shorter data type

Of course you do.  Another subject to look up in the books: what is the 
type of an integer constant?  You'll have to check the compiler manual 
here, too, because that's non-standard syntax in your constant.

> By changing the function prototype to expect an 'int' the warning goes
> away so I think the defined my_variable is being assigned as an 'int'

It's not assigned at all.  Please learn about the difference between the 
preprocessor and the compiler proper.

Back to comp.arch.embedded | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

XC8 novice question rwood <rwoodl@nowhere.com> - 2016-09-11 15:02 +0800
  Re: XC8 novice question Don Y <blockedofcourse@foo.invalid> - 2016-09-11 02:55 -0700
    Re: XC8 novice question rwood <rwoodl@nowhere.com> - 2016-09-11 18:25 +0800
      Re: XC8 novice question David Brown <david.brown@hesbynett.no> - 2016-09-11 13:35 +0200
        Re: XC8 novice question Don Y <blockedofcourse@foo.invalid> - 2016-09-11 07:32 -0700
          Re: XC8 novice question David Brown <david.brown@hesbynett.no> - 2016-09-11 16:58 +0200
            Re: XC8 novice question Don Y <blockedofcourse@foo.invalid> - 2016-09-11 13:15 -0700
              Re: XC8 novice question David Brown <david.brown@hesbynett.no> - 2016-09-12 08:55 +0200
                Re: XC8 novice question Don Y <blockedofcourse@foo.invalid> - 2016-09-12 02:41 -0700
                Re: XC8 novice question Mike Perkins <spam@spam.com> - 2016-09-12 13:16 +0100
                Re: XC8 novice question David Brown <david.brown@hesbynett.no> - 2016-09-12 14:56 +0200
                Re: XC8 novice question Mike Perkins <spam@spam.com> - 2016-09-12 14:33 +0100
                Re: XC8 novice question David Brown <david.brown@hesbynett.no> - 2016-09-12 16:11 +0200
                Re: XC8 novice question Jack <jack4747@gmail.com> - 2016-09-12 07:50 -0700
                Re: XC8 novice question David Brown <david.brown@hesbynett.no> - 2016-09-12 22:23 +0200
                Re: XC8 novice question Les Cargill <lcargill99@comcast.com> - 2016-09-12 15:34 -0500
                Re: XC8 novice question Don Y <blockedofcourse@foo.invalid> - 2016-09-12 08:44 -0700
                Re: XC8 novice question David Brown <david.brown@hesbynett.no> - 2016-09-12 14:35 +0200
                Re: XC8 novice question Don Y <blockedofcourse@foo.invalid> - 2016-09-12 08:19 -0700
                Re: XC8 novice question David Brown <david.brown@hesbynett.no> - 2016-09-12 23:11 +0200
                Re: XC8 novice question Dennis <dennis@none.none> - 2016-09-12 17:04 -0500
                Re: XC8 novice question Don Y <blockedofcourse@foo.invalid> - 2016-09-12 22:49 -0700
                Re: XC8 novice question David Brown <david.brown@hesbynett.no> - 2016-09-13 09:04 +0200
                Re: XC8 novice question Hans-Bernhard Bröker <HBBroeker@t-online.de> - 2016-09-13 00:16 +0200
                Re: XC8 novice question Don Y <blockedofcourse@foo.invalid> - 2016-09-12 21:22 -0700
                Re: XC8 novice question David Brown <david.brown@hesbynett.no> - 2016-09-13 12:25 +0200
                Re: XC8 novice question Dennis <dennis@none.none> - 2016-09-13 10:22 -0500
                Re: XC8 novice question David Brown <david.brown@hesbynett.no> - 2016-09-13 20:08 +0200
            Re: XC8 novice question rwood <rwoodl@nowhere.com> - 2016-09-12 16:50 +0800
          Re: XC8 novice question Tom Gardner <spamjunk@blueyonder.co.uk> - 2016-09-11 17:13 +0100
            Re: XC8 novice question Tom Gardner <spamjunk@blueyonder.co.uk> - 2016-09-11 17:19 +0100
              Re: XC8 novice question David Brown <david.brown@hesbynett.no> - 2016-09-12 09:00 +0200
      Re: XC8 novice question Don Y <blockedofcourse@foo.invalid> - 2016-09-11 07:28 -0700
    Re: XC8 novice question upsidedown@downunder.com - 2016-09-11 13:56 +0300
      Re: XC8 novice question David Brown <david.brown@hesbynett.no> - 2016-09-11 13:28 +0200
      Re: XC8 novice question Hans-Bernhard Bröker <HBBroeker@t-online.de> - 2016-09-11 13:36 +0200
        Re: XC8 novice question upsidedown@downunder.com - 2016-09-11 16:14 +0300
          Re: XC8 novice question Don Y <blockedofcourse@foo.invalid> - 2016-09-11 07:57 -0700
          Re: XC8 novice question Hans-Bernhard Bröker <HBBroeker@t-online.de> - 2016-09-12 22:52 +0200
            Re: XC8 novice question upsidedown@downunder.com - 2016-09-13 10:11 +0300
              Re: XC8 novice question Don Y <blockedofcourse@foo.invalid> - 2016-09-13 01:11 -0700
                Re: XC8 novice question upsidedown@downunder.com - 2016-09-13 13:24 +0300
                Re: XC8 novice question David Brown <david.brown@hesbynett.no> - 2016-09-13 12:39 +0200
                Re: XC8 novice question Don Y <blockedofcourse@foo.invalid> - 2016-09-13 15:41 -0700
                Re: XC8 novice question upsidedown@downunder.com - 2016-09-14 09:07 +0300
                Re: XC8 novice question Don Y <blockedofcourse@foo.invalid> - 2016-09-13 23:29 -0700
      Re: XC8 novice question Don Y <blockedofcourse@foo.invalid> - 2016-09-11 07:50 -0700
  Re: XC8 novice question Hans-Bernhard Bröker <HBBroeker@t-online.de> - 2016-09-11 13:42 +0200
  Re: XC8 novice question Tim Wescott <tim@seemywebsite.com> - 2016-09-11 20:14 -0500
  Re: XC8 novice question rwood <rwoodl@nowhere.com> - 2016-09-12 16:54 +0800
    Re: XC8 novice question David Brown <david.brown@hesbynett.no> - 2016-09-12 11:05 +0200
      Re: XC8 novice question rwood <rwoodl@nowhere.com> - 2016-09-12 18:48 +0800
  Re: XC8 novice question John Temples <usenet@xargs-spam.com> - 2016-09-12 17:33 +0000

csiph-web