Re: low-level question
- From: Zara <yozara@xxxxxxxx>
- Date: Wed, 31 Aug 2005 04:51:04 GMT
Keith Thompson wrote:
> SM Ryan <wyrmwif@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx> writes:
>
> Yes, it's useful to understand how undefined behavior can manifest
> itself. But in this particular case, I see no way to correct the
> problem without changing the code (other than just not running the
> program).
>
> There are times when workarounds can be useful until the underlying
> problem is corrected. I don't see that this is one of those cases.
>
jesso wrote:
> This is an
> "
> ASM/C Developer/Analyst - Linux platform
>
> Developer/analyst with strong skills in assembler and C on Linux.
> "
>
Ha! There is the answer. The company was looking for an ASM/C
Deelper/Analyst with experience in:
- Little endian machines
- Some specific C compilers (not all)
So thta they expect the programmer to recognize that the local
parameters will be put in the stack so that buf will be located in lower
addresses than i, and contiguous to it. That would be the reason for the
"0" appearing as result of printf.
And there must be some compiler (the one this company expects everyone
to konw and use) that allows the alignment constraints to be specified
for local variables, so thts something like forcing alignment on 8-boit
boundary as a compiler invocation option would do the trick.
I wouldn't worl in a company that expects such a limited kowledge of
reality from their workers, they are looking for a nice software crash
in front of a major customer... looking for problems.
.
- References:
- Re: low-level question
- From: SM Ryan
- Re: low-level question
- From: Keith Thompson
- Re: low-level question
- Prev by Date: Re: confused abt file operations
- Next by Date: Re: Code consolidation
- Previous by thread: Re: low-level question
- Next by thread: understanding format specifiers
- Index(es):