Skip to content

error in line 1124 in ESPAsyncWebServer.h #86

@yustAnotherUser

Description

@yustAnotherUser

IDE / Tooling

Arduino (IDE/CLI)

What happened?

it currently throws errors:

In file included from C:\Users\xyz\AppData\Local\Temp\.arduinoIDE-unsaved202584-10336-jruclv.qauw\sketch_sep4a\sketch_sep4a.ino:12:
c:\Users\xyz\Documents\Arduino\libraries\ESP_Async_WebServer\src/ESPAsyncWebServer.h: In member function 'tcp_state AsyncWebServer::state() const':
c:\Users\xyz\Documents\Arduino\libraries\ESP_Async_WebServer\src/ESPAsyncWebServer.h:1124:49: error: passing 'const AsyncServer' as 'this' argument discards qualifiers [-fpermissive]
 1124 |     return static_cast<tcp_state>(_server.status());
      |                                   ~~~~~~~~~~~~~~^~
In file included from c:\Users\xyz\Documents\Arduino\libraries\ESP_Async_WebServer\src/ESPAsyncWebServer.h:19:
c:\Users\xyz\Documents\Arduino\libraries\AsyncTCP\src/AsyncTCP.h:198:13: note:   in call to 'uint8_t AsyncServer::status()'
  198 |     uint8_t status();
      |             ^~~~~~
exit status 1

Compilation error: exit status 1

the line in ESPASyncWebServer.h currently looks like this:
return static_cast<tcp_state>(_server.status());

but it must be:
return static_cast<tcp_state>(const_cast<AsyncServer&>(_server).status());

fix by kimi.com

greetings

Edit: wrong repo. sorry.

Stack Trace

see initial post

Minimal Reproductible Example (MRE)

see initial post

I confirm that:

  • I have read the documentation.
  • I have searched for similar discussions.
  • I have searched for similar issues.
  • I have looked at the examples.
  • I have upgraded to the lasted version of AsyncTCP.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions