Ignoring Werror for one specific file

error #1696: Implicit pointer conversion changes byteorder of the pointed-to types from "bigendian int" to "int" if((processid = forkpty{{int*)&(execData->mFd)

I have multiple files being compiled by a single makefile. One of those files say xyz.cis giving me byte-order error I tried to resolve such errors using this https://software.intel.com/en-us/node/628915

But this one is sticky. No matter what I do it didn't go away.

Attempts Made:

1) Went through https://software.intel.com/en-us/node/628915 but nothing helped. 2)if I take this file say xyz.c out of the makefile and comment it then it gives me undefined reference to lots of functions which are used elsewhere. So this is obviously not a solution.

Need is to ignore this warning so I Wonder if there is a way to make-Wnoerror for a particular file being compiled inside a Makefile.

Upvotes: 1

Views: 1340

Answers (1)

Iharob Al Asimi
Iharob Al Asimi

Reputation: 53006

There are two possible options,

  1. Create a rule for the specific file in the Makefile, and don't pass -Werror when compiling it.

  2. Use what is described in this answer.

    #pragma GCC diagnostic ignored "-W(your specific warning)"
    

    you can re-enable the warning later if you like.

Upvotes: 3

Related Questions