Skip to content

Special treatment of null qstr means "NULL" is not valid in mpy-cross. #5140

@nevercast

Description

@nevercast

Minimum repro:

Create a file with the contents:

def expode():
    return "NULL"

Add this as a frozen file so that it is compiled with mpy-cross and output in to frozen.c.
frozen.c now conflicts with qstr.generated.h with a duplicate MP_QSTR_NULL definition.

Seems to work fine in the REPL, presumably because the string is not QSTRd (interned)

build-wscale/frozen_mpy.c:764:5: error: redeclaration of enumerator 'MP_QSTR_NULL'
     MP_QSTR_NULL,
     ^
In file included from ../../py/obj.h:31:0,
                 from ../../py/objint.h:30,
                 from build-wscale/frozen_mpy.c:2:
build-wscale/genhdr/qstrdefs.generated.h:3:6: note: previous definition of 'MP_QSTR_NULL' was here
 QDEF(MP_QSTR_NULL, (const byte*)"\x00\x00\x00" "")
      ^
../../py/qstr.h:41:23: note: in definition of macro 'QDEF'
 #define QDEF(id, str) id,
                       ^
../../py/mkrules.mk:47: recipe for target 'build-wscale/build-wscale/frozen_mpy.o' failed
make: *** [build-wscale/build-wscale/frozen_mpy.o] Error 1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy