Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

The 'DEF' statement is deprecated #27

Open
jwilk opened this issue Mar 10, 2023 · 2 comments
Open

The 'DEF' statement is deprecated #27

jwilk opened this issue Mar 10, 2023 · 2 comments

Comments

@jwilk
Copy link
Owner

jwilk commented Mar 10, 2023

When building with Cython 3.0.0b1, I get a few warnings like this:

afl.pyx:40:0: The 'DEF' statement is deprecated and will be removed in a future Cython version. Consider using global variables, constants, and in-place literals instead. See cython/cython#4310

These are the affected lines:

DEF SHM_ENV_VAR = b'__AFL_SHM_ID'
DEF FORKSRV_FD = 198
DEF MAP_SIZE_POW2 = 16
DEF MAP_SIZE = 1 << MAP_SIZE_POW2
@jwilk
Copy link
Owner Author

jwilk commented Mar 11, 2023

I've tried this:

cdef extern from *:
    # These constants must be kept in sync with afl-fuzz:
    '''
    #define SHM_ENV_VAR "__AFL_SHM_ID"
    #define FORKSRV_FD 198
    #define MAP_SIZE_POW2 16
    #define MAP_SIZE (1 << MAP_SIZE_POW2)
    '''
    extern const char *SHM_ENV_VAR
    extern int FORKSRV_FD
    extern int MAP_SIZE

It didn't quite work…
The docstring-for-extern works only since Cython 0.28 (cython/cython#1915), but we still support 0.19.

@jwilk
Copy link
Owner Author

jwilk commented Mar 11, 2023

Ubuntu 18.04 LTS (supported until April 2023) ships with Cython 0.26.1.

jwilk added a commit that referenced this issue Jun 22, 2023
FriedrichFroebel added a commit to FriedrichFroebel/python-djvulibre that referenced this issue Jul 27, 2023
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant