Coder Social home page Coder Social logo

CF - Incorrect cast in test functions about cf HOT 1 CLOSED

nasa avatar nasa commented on August 16, 2024
CF - Incorrect cast in test functions

from cf.

Comments (1)

jphickey avatar jphickey commented on August 16, 2024

Imported comment by internal user on Tue Nov 16 19:07:44 2021

Another example/form of this same issue appears in Test_CF_CFDP_R2_GapCompute_WhenGiven_c_size_IsGreaterThan_0_Increment_gap_counter, where it has:

pdu_nak_t dummy_nak;

followed by:

dummy_args.ph = (pdu_header_t*)&dummy_nak;

The case to (pdu_header_t*) here is not valid, because pdu_nak_t is an extension of pdu_header_t, not a replacement of it.

A more correct way to declare the buffer would be:

struct

{ pdu_header_t ph; pdu_nak_t nak; } dummy;

And then simply take the address of the ph and nak members, respectively.

from cf.

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.