Skip to content

objcsendmode fix needs to be ported to other languages #1

@abarnert

Description

@abarnert

For example, while building py-appscript for Python 3.3:

building 'aem.ae' extension
/usr/bin/clang -fno-strict-aliasing -fno-common -dynamic -DNDEBUG -g -O3 -arch i386 -arch x86_64 -I/Library/Frameworks/Python.framework/Versions/3.3/include/python3.3m -c appscript_3x/ext/ae.c -o build/temp.macosx-10.6-intel-3.3/appscript_3x/ext/ae.o -DMAC_OS_X_VERSION_MIN_REQUIRED=MAC_OS_X_VERSION_10_4
In file included from appscript_3x/ext/ae.c:16:
appscript_3x/ext/sendthreadsafe.c:360:15: warning: use of logical '&&' with constant operand [-Wconstant-logical-operand]
        if (sendMode && kAEWaitReply) {
                     ^  ~~~~~~~~~~~~
appscript_3x/ext/sendthreadsafe.c:360:15: note: use '&' for a bitwise operation
        if (sendMode && kAEWaitReply) {
                     ^~
                     &
appscript_3x/ext/sendthreadsafe.c:360:15: note: remove constant to silence this warning
        if (sendMode && kAEWaitReply) {
                    ~^~~~~~~~~~~~~~~
1 warning generated.
In file included from appscript_3x/ext/ae.c:16:
appscript_3x/ext/sendthreadsafe.c:360:15: warning: use of logical '&&' with constant operand [-Wconstant-logical-operand]
        if (sendMode && kAEWaitReply) {
                     ^  ~~~~~~~~~~~~
appscript_3x/ext/sendthreadsafe.c:360:15: note: use '&' for a bitwise operation
        if (sendMode && kAEWaitReply) {
                     ^~
                     &
appscript_3x/ext/sendthreadsafe.c:360:15: note: remove constant to silence this warning
        if (sendMode && kAEWaitReply) {
                    ~^~~~~~~~~~~~~~~
1 warning generated.

These warnings are accurate: If you set any sendMode bits at all, you effectively get all of them, instead of just the one you set.

I haven't tested Ruby or Python2 yet, but I'm guessing they have the same problem.

It's possible that some of the other ObjC fixes need to be ported as well.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions