[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: [OT] gcc-warnings



Daniel Reuter <reuter@Uni-Hohenheim.DE> writes:

> I never quite understood the following warning message from gcc:
> 
> sourcefile.c: linenumber: warning: assignment makes pointer from integer
> without a cast

Well, that means, that you use an integer, where an pointer is
expected.

See the following program:

int main (void)
{
  int *foo;

  foo = 5;

  return 0;
}

Here we have an variable 'foo', which is defined as an int pointer.
But, we want to assign an int to 'foo' and not an int pointer.

...Just an example.

	moritz
-- 
/* Moritz Schulte <moritz@hp9001.fh-bielefeld.de>
 * http://hp9001.fh-bielefeld.de/~moritz/
 * PGP-Key available, encrypted Mail is welcome.
 */



Reply to: