Skip to content

Various fixes for building with new compilers#466

Merged
starseeker merged 17 commits intostepcode:developfrom
starseeker:buildfixes
Feb 6, 2026
Merged

Various fixes for building with new compilers#466
starseeker merged 17 commits intostepcode:developfrom
starseeker:buildfixes

Conversation

@starseeker
Copy link
Member

As well as one behavior correction - rather than trying to use a NULL pointer deference to crash in an error case (bad practice and undefined behavior anyway) return an error attribute calling applications can deal with gracefully.

Copilot AI and others added 6 commits December 5, 2025 14:01
Co-authored-by: starseeker <238416+starseeker@users.noreply.github.com>
Co-authored-by: starseeker <238416+starseeker@users.noreply.github.com>
…arations

Co-authored-by: starseeker <238416+starseeker@users.noreply.github.com>
Improves error handling in STEPattributeList operator[] - return an
error attribute and set error state rather than trying to rely on
crashing via a NULL deference.  That's undefined behavior, so it
was not guaranteed - this requires the calling code to check the
return, but is *much* cleaner.

Co-authored-by: starseeker <238416+starseeker@users.noreply.github.com>
Co-authored-by: starseeker <238416+starseeker@users.noreply.github.com>
@TRThurman
Copy link
Member

Does the latest EXPRESS compiler updates successfully compile the AP 242 ed4 long form schema:
10303-442?

@starseeker
Copy link
Member Author

@cshorler Are you still active with stepcode?

@starseeker
Copy link
Member Author

@TRThurman A quick experiment shows the following error from the schema scanner:

mim_lf.exp:34148:
  --ERROR PE056: Query expression source must be an aggregate.

That's this block:

ENTITY styled_item
  SUBTYPE OF (representation_item);
  styles : SET [0 : ?] OF presentation_style_assignment;
  item   : styled_item_target;
WHERE
  WR1: (SIZEOF(styles) = 0) AND
       ('AP242_MANAGED_MODEL_BASED_3D_ENGINEERING_MIM_LF.STYLED_TESSELLATED_ITEM_WITH_COLOURS' IN TYPEOF(SELF)) OR
       (SIZEOF(styles) = 1) OR
       (SIZEOF(styles) > 1) AND
       (SIZEOF(QUERY(pres_style
                     <* styles
                     | NOT ('AP242_MANAGED_MODEL_BASED_3D_ENGINEERING_MIM_LF.PRESENTATION_STYLE_BY_CONTEXT' IN
                            TYPEOF(pres_style)))) =
        0);
  WR2: NOT ('AP242_MANAGED_MODEL_BASED_3D_ENGINEERING_MIM_LF.STYLED_ITEM' IN TYPEOF(item));
  WR3: ('AP242_MANAGED_MODEL_BASED_3D_ENGINEERING_MIM_LF.MAPPED_ITEM' IN TYPEOF(item)) OR
       ('AP242_MANAGED_MODEL_BASED_3D_ENGINEERING_MIM_LF.GEOMETRIC_REPRESENTATION_ITEM' IN TYPEOF(item)) OR
       (('AP242_MANAGED_MODEL_BASED_3D_ENGINEERING_MIM_LF.SET_REPRESENTATION_ITEM' IN TYPEOF(item)) AND
        (SIZEOF(QUERY(it
                      <* item
                      | NOT (('AP242_MANAGED_MODEL_BASED_3D_ENGINEERING_MIM_LF.MAPPED_ITEM' IN TYPEOF(it)) OR
                             ('AP242_MANAGED_MODEL_BASED_3D_ENGINEERING_MIM_LF.GEOMETRIC_REPRESENTATION_ITEM' IN
                              TYPEOF(it))))) =
         0));
END_ENTITY;

The short answer is no, stepcode apparently can't handle it at the moment. I'm not quite sure what it would take to support it - it could be fairly non-trivial, judging by a quick round with Copilot.

@starseeker starseeker merged commit e79c15d into stepcode:develop Feb 6, 2026
6 checks passed
@TRThurman
Copy link
Member

It turns out that is a critical aggregate.
Suggestions:
Review open cascade step interface implementation;
Review express engine p21 interface: express engine project on sourceforge (lisp but may offer insights)
Review expressir (ruby) on GitHub.
My suspicion is that they treat set_representation_item like a second-class entity but not seeing their implementation I can't assert anything.
I do know that the commercial interfaces have been forced to implement support for that aggregate pattern.
It is used in AP242ed4 as an integral part of the uuid scope.
Second-class because it does not have its own record, but it is a named type.
Let me know if you want to pursue further.

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

Successfully merging this pull request may close these issues.

3 participants