Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

fluid.list2buf fails build with negative subscript error #371

Open
lewardo opened this issue Aug 2, 2023 · 0 comments
Open

fluid.list2buf fails build with negative subscript error #371

lewardo opened this issue Aug 2, 2023 · 0 comments

Comments

@lewardo
Copy link
Member

lewardo commented Aug 2, 2023

When compiling on Windows 10 and 11 with Visual Studio Tools 2022 and Max SDK version 8.2.0, fluid.list2buf fails to compile, only for debug targets

2>fluid.list2buf.cpp
2>C:\Users\lewar\Documents\flucoma\flucoma-max\source\include\clients/nrt/FluidListToBuf.hpp(88,3): error C2118: negative subscript
2>C:\Users\lewar\Documents\flucoma\flucoma-max\source\include\clients/nrt/FluidListToBuf.hpp(125,36): warning C4244: 'argument': conversion from 'long' to 'short', possible loss of data
2>C:\Users\lewar\Documents\flucoma\flucoma-max\source\include\clients/nrt/FluidListToBuf.hpp(142,29): warning C4244: 'argument': conversion from 'long' to 'short', possible loss of data
2>C:\Users\lewar\Documents\flucoma\flucoma-max\source\include\clients/nrt/FluidListToBuf.hpp(256,69): warning C4244: 'return': conversion from 't_atom_float' to 'float', possible loss of data
2>Done building project "fluid.list2buf.vcxproj" -- FAILED.

traced into fluid.list2buf.cpp:88

 CLASS_ATTR_SYM(FluidListToBufClass, "destination", 0, FluidListToBuf, outName);

which expands to

#define CLASS_ATTR_SYM(c,attrname,flags,structname,structmember) \
		{		\
			C74_STATIC_ASSERT(structmembersize(structname,structmember)==sizeof(t_symbol*), "structmember must be t_symbol* type"); \
		class_addattr((c),attr_offset_new(attrname,USESYM(symbol),(flags),(method)0L,(method)0L,calcoffset(structname,structmember))); \
		}

so assuming the error is in class_addattr((c),attr_offset_new(attrname,USESYM(symbol),(flags),(method)0L,(method)0L,calcoffset(structname,structmember))) given error message emitted

looking on the Max issues this bug has already been encountered in Cycling74/max-sdk#54

The issue was closed and seems to be an issue with the max-sdk update from 8.0.3 to 8.2.0, they updated the macro for their type, but my knowledge of the SDK isn't refined enough to know the equivalent fix since their error was a float/double CLASS_ATTR rather than a t_symbol

@junofern is on the case with a possible fix

fearn-e added a commit to fearn-e/flucoma-max that referenced this issue Aug 2, 2023
weefuzzy referenced this issue in fearn-e/flucoma-max Aug 4, 2023
tremblap pushed a commit that referenced this issue Aug 10, 2023
* changed outName from atom to symbol

* added {nullptr} to outName for consistency
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant