GithubHelp home page GithubHelp logo

Comments (7)

arithy avatar arithy commented on July 17, 2024

Sorry, I cannot investigate the problems because I don't have AIX.
So, can you share more detailed information below?
(1) the header file that defines FALSE macro conflicting with PackCC's one
(2) whether char type is surely recognized as a signed integer type in the compiler or not (like C++)
(3) whether the macro __SIZEOF_SIZE_T__ is defined in the system headers or not (can be checked by the command 'echo | gcc -std=gnu89 -dM -E - | grep __SIZEOF_SIZE_T__')

from packcc.

XSven avatar XSven commented on July 17, 2024

Answer to (1)
The header file /opt/freeware/lib/gcc/powerpc-ibm-aix7.2.0.0/8.3.0/include-fixed/sys/types.h defines the FLASE and TRUE macros types.h.txt.

Answer to (2)
I have compiled

#include <stdio.h>
int main(void) {
        printf("%d\n", (char)-1 < 0);
        return 0;
}

with

gcc -std=gnu89 -Wall -Wextra -Wno-unused-parameter -Wno-overlength-strings -pedantic -O0 -g2 main.c

Executing a.out returns 0 (false). That means char type is not a signed integer type. Using the compiler option -fsigned-char the result is 1 (true).

Answer to (3)

echo | gcc -std=gnu89 -dM -E - | grep __SIZEOF_SIZE_T__
#define __SIZEOF_SIZE_T__ 4

from packcc.

arithy avatar arithy commented on July 17, 2024

Thanks for the information.

--

About (1):

OK, AIX's sys/types.h header file defines the macros.
I think that it's none of AIX's business.
Anyway, they might exist due to historical reasons.

Can you insert undef lines in packcc.c as follows?

  #ifndef __attribute__
  #define __attribute__(x)
  #endif

+ #undef TRUE
+ #undef FALSE

  #define VERSION "1.5.0"

About (2):

As you said, can you add -fsigned-char compiler option?
I didn't know that there are platforms where the default char type is unsigned even in C.

About (3);

Currently, I don't find the cause of the warning of x |= x >> 32;.
This line should be excluded by #if directive when size_t is a 4-byte data type.

#if (defined __SIZEOF_SIZE_T__ && __SIZEOF_SIZE_T__ == 8) /* gcc or clang */ || defined _WIN64 /* MSVC */
    x |= x >> 32;
#endif

Can you investigate this unexpected behavior using gcc for AIX?

--

I'll commit the modifications, after you confirmed that compilation and execution are successfully done.

from packcc.

arithy avatar arithy commented on July 17, 2024

About (3):

I forgot to push the commit 6035daa.
#if ... || !defined _M_IX86 --> #if ... || defined _WIN64
This should fix the problem regarding x |= x >> 32;.
Please confirm it.

from packcc.

arithy avatar arithy commented on July 17, 2024

I pushed the commits that might fix this issue.
Can you confirm compilation and execution on your AIX environment?

cd build/gcc
make
make check  # bats-core and uncrustify are required (see tests/README.md)

from packcc.

XSven avatar XSven commented on July 17, 2024

make runs without any issue. As you have already noticed I am not able to run make check due to the missing tools. If you don't mind (?!) I am skipping this because this drives me too far away from my original goal to compile universal-ctags that packcc was a part of.

I am considering this issue as solved. Thanks for your help.

from packcc.

arithy avatar arithy commented on July 17, 2024

OK, I close this issue.

from packcc.

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.