Segfault on simple C code

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

 



Hi,

I'm trying to run atlast using gcc:

$ gcc -v
Using built-in specs.
Target: i486-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Debian 4.3.3-3' --with-bugurl=file:///usr/share/doc/gcc-4.3/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --enable-shared --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --enable-nls --with-gxx-include-dir=/usr/include/c++/4.3 --program-suffix=-4.3 --enable-clocale=gnu --enable-libstdcxx-debug --enable-objc-gc --enable-mpfr --enable-targets=all --enable-cld --with-tune=generic --enable-checking=release --build=i486-linux-gnu --host=i486-linux-gnu --target=i486-linux-gnu
Thread model: posix
gcc version 4.3.3 (Debian 4.3.3-3)

The compilation succeeds. The original source is unchanged but for adding some includes.
cc -g      -c -o atlast.o atlast.c
cc -g      -c -o atlmain.o atlmain.c
cc -g    atlast.o atlmain.o -o atlast -lm

Why is the following line segfaulting? What changes are required to the source or command line?
   *(dw->wname) |= WORDUSED;

Where WORDUSED is defined as:
#define WORDUSED    2              /* Word used by program */

Where dw is defined as:
typedef struct dw {
   struct dw *wnext;              /* Next word in dictionary */
char *wname; /* Word name. The first character is actually the word flags, including the (IMMEDIATE) bit. */
   codeptr wcode;              /* Machine code implementation */
} dictword;

tia,
jec


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux