Welcome, Guest
You have to register before you can post on our site.

Username
  

Password
  





  Dir 4.8 If no pointer is declared but implementation is visible
Posted by: cxlin - 29-03-2018, 11:11 AM - Forum: 7.4 Code design - Replies (1)

For Dir 4.8 the document is not clear about whether the following case should be considered as non-compliant.

/* def.h */
struct SomeType
{
/* Object implementation */
}

/* no-use.c */
#include def.h
/* Do something. But no use of SomeType at all. */

The example doesn't involve any pointer but indeed goes against the rationale since the implementation details of SomeType is not needed in no-use.c and it should at least be opaque. Also, logically, "no pointer" implies "a pointer is never dereferenced", since there is no such pointer to begin with.

Please kindly help to advise. Thanks!

Print this item

  Rule 13.2 Compliance
Posted by: rcseacord - 21-03-2018, 06:51 PM - Forum: 8.13 Side effects - Replies (2)

Does the following expression comply with Rule 13.2?

(x = a) && (x = b)

What if it is preceded by the following declaration?

int a = 0;

Thanks,
rCs

Print this item

  News on future releases
Posted by: pdrudi - 15-03-2018, 02:32 PM - Forum: MISRA AC SLSF discussions - Replies (1)

Hi,
will MISRA AC SLSF guideline be updated?
If yes, is there a planned release date?

Thank you in advance,
Paolo Drudi

Print this item

  Rule 20.2
Posted by: kalpak - 08-03-2018, 03:06 PM - Forum: 8.20 Preprocessing directives - Replies (2)

Why is
#include "c:\headers\measurement_regs.h "
non compliant to rule 20.2 due to \ in the path?

Print this item

  model information blocks in virtual subsystems (rule 022)
Posted by: ben.call - 06-03-2018, 06:55 PM - Forum: MISRA AC SLSF discussions - Replies (1)

MISRA AC SLSF 022 states that a model information block is required for every subsystem. Does application of this rule include virtual subsystems, or only "true" (i.e., atomic or nonvirtual) subsystems?
Stated differently: Virtual subsystems should share the identity and origin of the parent model, atomic subsystem, or library to which they belong (the rationale for rule 022), so do they need that information reiterated in their own model information block?
I would appreciate knowing what the community consensus is on this topic.
~Ben

Print this item

  Copyright
Posted by: ankitshah413 - 05-03-2018, 09:47 AM - Forum: MISRA-C:2004 Exemplar Suite - Replies (1)

Hello,

I have one question regarding the copyright of the Exemplar Suite. I want to share this with my colleagues in my company, so am i allowed to do that?

We have an internal tool for sharing , can i upload these examples there?

It will be accessed in my company only.

Thank you.

Print this item

  Rule 5.2 : confusion
Posted by: ankitshah413 - 01-03-2018, 04:08 PM - Forum: 6.5 Identifiers - Replies (2)

Hello,

I am getting MISRA 5.2 rule violation in my project. The code for which i am getting violation is a structure that is declared as extern in one header file. The code example is as under

1.h

Code:
extern struct con tmp_ev;

2.c
Code:
struct con tmp_ev;
cioF_get(&tmp_ev);

3.c
Code:
struct con tmp_ev;
(void)eeF_read(CON, &tmp_ev);

I get the warning only in 2.c in the line struct con tmp_ev; saying that declaration of symbol tmp_ev hides symbol tmp_ev and not in 3.c . Both 2.c and 3.c include the 1.h header file.

I am confused why this issue is present. Can anyone help me resolve this issue?

Thank you

Print this item

  Rule 8.3 Function definition
Posted by: ankitshah413 - 21-02-2018, 10:12 AM - Forum: 6.8 Declarations and Definitions - Replies (1)

I want to just clarify that following is a MISRA violation before using it in my code. I am calling one function from a file as under:

Code:
(void)Dem_SetEventStatus((Dem_EventIdType)(dtcFlt_t.dtc[dtcIndex]), DEM_EVENT_STATUS_FAILED);

Here Dem_SetEventStatus is defined in one header as under:

Code:
extern FUNC(Std_ReturnType, RTE_CODE) Dem_SetEventStatus (Dem_ASR42_EventIdType EventId, Dem_ASR42_EventStatusType EventStatus);

Here Dem_EventIdType is a typedef of unit8 and Dem_ASR42_EventIdType is unsigned short.

So , there were the violation of MISRA 8.3 right??

Print this item

  9.1 Variable may not have been initialized
Posted by: ankitshah413 - 19-02-2018, 11:51 AM - Forum: 6.9 Initialisation - Replies (4)

Hello,

I have an issue with MISRA 9.1 rule. In my code i have a "if" loop and inside that a variable is initialized and then is read after that. But when i do static analysis using pclint then i have a warning for 9.1 rule. Below is my code :

struct mgm2_info_return msg_ascu_info;

Code:
if(klr_ecuConf_t->feat_multislave)
    {
        msg_ascu_info = mgmF_massage_get_ascu_info();
    }
    msg_info = mgmF_massage_get_info();

The line where it is read and where warning occurs:
Code:
if( (((vF_mcms_fl_on((tm_uint8)V_FLONCMD_ACK)) ||
          (msg_info.pmcu_state ==  LDF_MASSSQC_STATE_ACTIVE))
                    &&((klr_ecuConf_t->feat_multislave)
                    || (msg_ascu_info.ascu_state ==  LDF_MASSSQC_STATE_ACTIVE))
        ) &&
        (msg_info.pmcu_trig_source == RqSource_ActvComf))

Do i need to write a justification or i need to initialize the entire structure first?

Print this item

  Rule 8.3: Symbol redeclared
Posted by: ankitshah413 - 16-02-2018, 12:34 PM - Forum: 6.8 Declarations and Definitions - Replies (11)

Hello,

I am facing an issue relating to rule 8.3. I am fixing MISRA violations in the project. The following code line is where i have issue:

in one of the files in the project i have the following code line:

dies->DrvPosn_D_SvRc_Rq = get_DrvPosn_D_SvRc_Rq();

get_DrvPosn_D_SvRc_Rq() is defined in other file as below:

tm_uint8 get_DrvPosn_D_SvRc_Rq(void)
{
return cio_DrvPosn_D_SvRc_Rq;
}

When i am performing the MISRA check , i get a error at 'dies->DrvPosn_D_SvRc_Rq = get_DrvPosn_D_SvRc_Rq();' line saying that Symbol 'get_DrvPosn_D_SvRc_Rq(void)' redeclared .

All the variables have same datatype tm_uint8;

Can you point out where the issue lies?

Thank you!

Ankit

Print this item

Search Forums

(Advanced Search)

Forum Statistics
» Members: 6,309
» Latest member: 1fuhd
» Forum threads: 1,066
» Forum posts: 2,933

Full Statistics

Online Users
There are currently 178 online users.
» 0 Member(s) | 175 Guest(s)
Bing, Google, UptimeRobot

Latest Threads
13.2 Was TC2 correctly ap...
Forum: 8.13 Side effects
Last Post: misra-c
08-10-2026, 12:47 PM
» Replies: 1
» Views: 624
20.12 Does the stringific...
Forum: 8.20 Preprocessing directives
Last Post: misra-c
08-10-2026, 12:40 PM
» Replies: 1
» Views: 554
13.3 Should side effects ...
Forum: 8.13 Side effects
Last Post: misra-c
08-10-2026, 12:37 PM
» Replies: 1
» Views: 427
11.6 pointer to pointer t...
Forum: 8.11 Pointer type conversions
Last Post: misra-c
08-10-2026, 12:21 PM
» Replies: 2
» Views: 1,032
What is the UTLR of -1?
Forum: 8.10 The essential type model
Last Post: misra-c
08-10-2026, 12:15 PM
» Replies: 1
» Views: 597
10.3 Clarify if narrower ...
Forum: 8.10 The essential type model
Last Post: misra-c
08-10-2026, 11:57 AM
» Replies: 1
» Views: 508
It 8.12 intended to be so...
Forum: 8.8 Declarations and defnitions
Last Post: misra-c
08-10-2026, 11:50 AM
» Replies: 1
» Views: 455
Rule 0.1.1 Example f4
Forum: 4.0 Language independent issues
Last Post: cgpzs
07-10-2026, 11:07 AM
» Replies: 3
» Views: 723
Rule 6-2-2 Usage of std::...
Forum: 6.6 Statements (C++)
Last Post: misra cpp
25-09-2026, 05:43 PM
» Replies: 1
» Views: 436
M5-0-4 switch over unscop...
Forum: 6.5 Expressions (C++)
Last Post: misra cpp
25-09-2026, 01:00 PM
» Replies: 3
» Views: 537