Giter Site home page Giter Site logo

src/AMQPMessage.cpp about amqpcpp HOT 8 OPEN

akalend avatar akalend commented on July 28, 2024
src/AMQPMessage.cpp

from amqpcpp.

Comments (8)

chifho avatar chifho commented on July 28, 2024 1

from amqpcpp.

chifho avatar chifho commented on July 28, 2024 1

from amqpcpp.

ChrisPappalardo avatar ChrisPappalardo commented on July 28, 2024 1

There is an error during compilation of the file at line 48. The signature of the function is:
char * AMQPMessage::getMessage(uint32_t* length)

On line 48, the return statement is:
return '\0'

which is a char. And it does not agree with the return type.

I would like to suggest to change it to:
return NULL;
or
return (char *) '\0';

I have this same issue on Ubuntu 18.04.2 LTS using g++ (Ubuntu 7.3.0-27ubuntu1~18.04) 7.3.0 and the following change to line 48 resolved the compilation error:

return (char *) '\0';

Thanks

from amqpcpp.

TomeC avatar TomeC commented on July 28, 2024

你用的什么编译器
What compiler do you use?
my compiler version
gcc 版本 4.8.5 20150623 (Red Hat 4.8.5-11) (GCC)

from amqpcpp.

TomeC avatar TomeC commented on July 28, 2024

NULL == '\0' == 0

from amqpcpp.

TomeC avatar TomeC commented on July 28, 2024

Different compiler restrictions are not the same.
You can modify the code to adapt to different compilers.
By the way, where are you from?

from amqpcpp.

chifho avatar chifho commented on July 28, 2024

Yes, I could modify the code to make it work. However, since I am pulling the git directly from within the Docker Container and do the build within, it would be nice that the fix can be done at the source instead of having a custom script to modify the source.

from amqpcpp.

zhanb avatar zhanb commented on July 28, 2024

你这代码不严谨啊,不能怪人家编译器,一个是char,一个是char*

from amqpcpp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.