Re: Compiler error

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

 



On Thu, 3 Oct 2024 at 22:19, Natalie Tracy Anne Bloxam via Gcc-help <
gcc-help@xxxxxxxxxxx> wrote:

> Hi,
> I'm on a server that uses gcc v8.5.0, trying to recompile my pennmush 1.8.7
> based mush and I am running into this specific error:
>
> myssl.c:310:5: error: dereferencing pointer to incomplete type 'DH' {aka
> 'struct dh_st'}
> dh->p = BN_bin2bn(dh2048_p, sizeof(dh2048_p), NULL);^~
>
> I know where that line of code is located, but I'm not really sure what the
> issue is or how to fix it as I'm a bit new to this side of coding in C, and
> never had to deal with any server side issues before now.
> If you could give me any insight on how to fix this, that would be great. I
> perused the manual but I couldn't find anything to help me with this in
> particular.
>


The error is complaining that dh->p is accessing the "p" member of a
"struct dh_st" object, but at that point in the code struct dh_st has not
been defined. There is just a declaration telling the compiler that struct
dh_st exists, but nothing else about it, such as which members it has, and
the types of those members. The compiler cannot generate code to access the
member named "p" if it doesn't know where in struct dh_st that member is.

e.g. consider that if struct dh_st looked like this:

struct dh_st {
  int i;
  int p;
};

then it would be very different from:

struct dh_st {
  char* p;
};

So the code it needs to generate for dh->p depends on how struct dh_st is
defined.

The fix is probably to find which header contains the definition of struct
dh_st and then #include that header at the top of myssl.c



[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