Re: Difference between variables and functions
From: Wayne C. Morris (wayne.morris_at_this.is.invalid)
Date: 08/30/05
- Next message: Alan Balmer: "Re: Jargons of Info Tech industry"
- Previous message: Rich Teer: "Re: Guaranteed Term Restore w/ atexit(3) No Good"
- In reply to: joe_at_invalid.address: "Re: Difference between variables and functions"
- Next in thread: Ulrich Hobelmann: "Re: Difference between variables and functions"
- Reply: Ulrich Hobelmann: "Re: Difference between variables and functions"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Tue, 30 Aug 2005 17:29:10 GMT
In article <m37je4kky6.fsf@invalid.address>, joe@invalid.address wrote:
> Ulrich Hobelmann <u.hobelmann@web.de> writes:
>
> > Wow, I've never experienced C being that anal about types (except
> > when it doesn't know the size of a struct that it needs for
> > allocation). I assumed that it's all just memory addresses
> > underneath, with some loose checking on top.
>
> The OP's code set an int to 4. Then it tried to call the value 4 as a
> function, which would mean (I guess) that the compiler was expected to
> generate code that would just jump to address 4 and start executing.
>
Well, that's what his code tried to do, but that's not what he intended; he
thought he should be allowed to have both a function and a variable named
"read" in the same scope, and that the C compiler should be "smart enough"
to figure out from context which 'read' was being referenced. The OP
simply asked whether this really is invalid in C.
Ulrich thought the OP *wanted* to call a function at memory address 4,
resulting in this tangential discussion about whether C should let you
'call' an int variable without an explicit cast.
- Next message: Alan Balmer: "Re: Jargons of Info Tech industry"
- Previous message: Rich Teer: "Re: Guaranteed Term Restore w/ atexit(3) No Good"
- In reply to: joe_at_invalid.address: "Re: Difference between variables and functions"
- Next in thread: Ulrich Hobelmann: "Re: Difference between variables and functions"
- Reply: Ulrich Hobelmann: "Re: Difference between variables and functions"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|