neutrinolabs / xrdp

xrdp: an open source RDP server
http://www.xrdp.org/
Apache License 2.0
5.57k stars 1.73k forks source link

Warnings that become errors on mcst-lcc compiler (-Werror option) #2870

Closed r-a-sattarov closed 6 months ago

r-a-sattarov commented 8 months ago

xrdp version

0.9.23.1

Detailed xrdp version, build options

  mp3lame                 yes
  opus                    no
  fdkaac                  no
  jpeg                    no
  turbo jpeg              no
  rfxcodec                yes
  painter                 yes
  pixman                  yes
  fuse                    yes
  ipv6                    no
  ipv6only                no
  vsock                   no
  auth mechanism          PAM
  rdpsndaudin             no

  with imlib2             no
  with freetype2          no

  development logging     no
  development streamcheck no

  strict_locations        no
  prefix                  /usr/local
  exec_prefix             ${prefix}
  libdir                  ${exec_prefix}/lib
  bindir                  ${exec_prefix}/bin
  sysconfdir              /etc
  pamconfdir              /etc/pam.d
  localstatedir           /var
  runstatedir             ${localstatedir}/run
  socketdir               ${localstatedir}/run/xrdp

  unit tests performable  yes

Operating system & version

OS Elbrus 7.2 (Linux 5.4, mcst-lcc compiler 1.26)

Installation method

git clone & make install

Which backend do you use?

No response

What desktop environment do you use?

Xfce

Environment xrdp running on

Elbrus-8C CPU

What's your client?

No response

Area(s) with issue?

Compile error

Steps to reproduce

./bootstrap ./configure --enable-fuse --enable-mp3lame --enable-pixman make

✔️ Expected Behavior

Compilation without errors.

❌ Actual Behavior

When compiling with the mсst-lcc compiler (gcc compatible), I get errors that are caused by the "-Werror" option.

After commenting out this option, the project can be compiled.

Is it possible to fix all these warnings (thar become errors with -Werror option)?

lcc: "scp_process.c", line 74: in function "process_sys_login_request":
lcc: "scp_process.c", line 143: warning: variable "errorcode" may be used
          uninitialized [-Wmaybe-uninitialized]

lcc: "xrdp_mm.c", line 241: in function "xrdp_mm_create_session":
lcc: "xrdp_mm.c", line 273: warning: variable "type" may be used uninitialized
          [-Wmaybe-uninitialized]

Anything else?

No response

matt335672 commented 8 months ago

@r-a-sattarov - you don't seem to be compiling v0.9.23.1 as you've reported. I can't find the file scp_process.c in that release. Am I missing something?

r-a-sattarov commented 8 months ago

@r-a-sattarov - you don't seem to be compiling v0.9.23.1 as you've reported. I can't find the file scp_process.c in that release. Am I missing something?

Sorry, I used the current dev-version of xrdp.

Files:

matt335672 commented 8 months ago

I'd be happy to fix v0.9.23.1 as you suggest.

The problem with the dev version is it's changing a lot at the moment and since we don't have access to your compiler (which doesn't seem to be open source) we can't easily prevent this happening again. I'm not picking up this error with any of the current CI tools we have.

If you're prepared to put the work in to put a PR together, I'll merge it for you but be aware that this could happen again.

matt335672 commented 8 months ago

Just to add a bit of context, the reported errors are false positives (as far as I can tell), but I don't think your compiler is doing sufficuent path analysis to determine this.