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

Username
  

Password
  





  Clarification for 5-0-20 (operands to a binary bitwise operator)
Posted by: udi - 05-02-2019, 03:52 PM - Forum: 6.5 Expressions (C++) - Replies (1)

Hi,

Just to clarify what seems to be a mistake in the implementation of the static analysis tool I use:
According to the rationale, I believe that this rule does not refer to the shift operators, but only to following 6 operators:
&
|
^
&=
|=
^=
Am I right about this?

Thanks,
Udi.

Print this item

  Rule 10-3-3 Re-declaring pure function
Posted by: nishiyama - 05-02-2019, 03:57 AM - Forum: 6.10 Derived classes (C++) - Replies (2)

Hi.

Rules 10-3-3 Rationale has the following description.

Re-declaring a function as pure may not meet developer expectations.

What do the developers expect?
What does it mean that it does not meet the expectations of developers?

Print this item

  Rules 16-2-3
Posted by: nishiyama - 05-02-2019, 03:52 AM - Forum: 6.16 Preprocessing directives (C++) - Replies (2)

Rules 16-2-3 Rationale has the following description.

If this multiple inclusion leads to multiple or conflicting definitions,
then this can result in undefined or erroneous behaviour.

I understood that it would be a multiple definition.

However, I do not understand the case of conflicting definition.
What kind of cases are there?

Print this item

  Dir 4.7 Unclear exactly what the critera is?
Posted by: chuck.cannon - 31-01-2019, 06:57 PM - Forum: 7.4 Code design - Replies (2)

What does it mean to be "tested in a meaningful manner"?

Is there any requirement on what is done once tested? For example, if there is no corrective action is it sufficient to just log the error?

Does returning the error to the caller qualify? In an API, the implementation of a API function may call subsequent functions that return an error. If only one such function is called then the only thing to do with the error is return it to the original caller.

err_t func1(void)
{
}

err_t func2(void)
{
return func1();
}

In our project, almost the entire code base running on the uC is a library exposed via an IPC link. All errors are just propagated back up and eventually sent back across the link to the caller.

Print this item

  10.8 Violation understanding details
Posted by: ashutosh.parate - 17-01-2019, 03:18 PM - Forum: 8.10 The essential type model - Replies (1)

Dear All,

I have read MISRA guidelines and tried to implement in my source code, After running in static code analysis tool it give me 10.8 violation for the below expression saying

" The value of a composite expression shall not be cast to a different essential type category or a wider essential type."

u16 param_val_u16 = 0U;

param_val_u16 = (u16)(brk_itbv_p_brk_hsd_isense.Voltage_Filtered_u32 / 50U);

Can anyone please try to justify what exactly it meant to make it compliant even if I did the intent explicit type casting of u16 to achieve the destination.

Thanks in advance,

Print this item

  MISRA C++ Working Group membership
Posted by: vladisld - 16-01-2019, 10:20 PM - Forum: C++ General - Replies (1)

Few questions about MISRA C++ Working Group and its membership:

1. What is the process of applying for the membership in the C++ Working Group for the company? What are the requirements for such membership ?
2. How often the working group meetings are taking place ?

Thanks
Vlad

Print this item

  Rule 5-2-6 and dynamicaly loading (.dll / .so)
Posted by: udi - 18-12-2018, 08:42 AM - Forum: 6.5 Expressions (C++) - Replies (3)

The rule forbids conversion between function pointer types.
I believe that this rule should exempt a function retrieved with GetProcAddress / dlsym, as I believe this is not an undefined / unspecified behavior (or is it?).
It might make sense to add a requirement to review and document these cases.

Print this item

  MISRA C makes SW "robust" against compiler failures
Posted by: andream - 05-12-2018, 05:04 PM - Forum: General Questions - Replies (3)

As known, EN 50128:2011 standard asks for evidence that a tool failure might not impact the software safety. In particular, emphasis is placed upon tools that might generate outputs which can directly or indirectly contribute to the executable code (including data) of the safety-related system. Therefore compilers are the first to be assessed in this respect. In case of C language, regardless if certain evidence is available of a compiler full conformance with ISO/IEC 9899:1999 (C99) standard, I was wondering if, at least based on gathered experience, the source code full compliance with MISRA C:2012 makes the source code itself more "robust" against possible residual failures of the compiler. In other words, if it can be said that upon fully complying with MISRA C:2012, the largest part of current compilers does not exhibit failures.

Print this item

  Rule 8.7 clarification needed
Posted by: GerlindeKettl - 28-11-2018, 10:49 AM - Forum: 8.8 Declarations and defnitions - Replies (6)

I have a project with functions which architecturally belong to one file and have external linkage so that they can be called from other parts of the software. A code checker tool claims that if one of these functions is called only from one other file in the project, this is a rule 8.7 violation and that I should move the definition of the function to the file which calls it (which would mess up the functional partitioning). Is this really intended by rule 8.7?

The rationale of the rule says: “Similarly, reducing the visibility of a function by giving it internal linkage reduces the chance of it being called inadvertently.” So, I've interpreted this rule as "if you use a function only in the translation unit where it is defined, make it static". But for example library functions are intended to be called by anyone who needs them and cannot be called inadvertently.

Could you please clarify what the correct interpretation is?

Print this item

  Certified C++ Standard Library
Posted by: dejanpan - 10-10-2018, 02:22 AM - Forum: C++ General - No Replies

Hi there. We are working on the automotive framework for programming of autonomous cars. Our framework has features that are very similar to those in Adaptive Autosar: https://www.autosar.org/standards/adaptive-platform/. We plan to certify this framework as a Safety Element Out of Context according to ISO 26262.

The framework is written in C++ and makes rather heavy use of constructs implemented in Standard Library (see below for the full list). Many C++ keywords like throw or lambdas use the C++ standard library. So removing the C++ standard library would lead to a dysfunctional compiler.

We are aware of 3 Standard Library implementations:
1. LLVM libc++: https://libcxx.llvm.org/docs/
2. GCC libstdc++: https://gcc.gnu.org/
3. Dinkumware: https://www.dinkumware.com/

Now the problem is that none of the above libraries are certified according to ISO 26262.

Questions:
1. **Are you aware of any ISO 26262 certified Standard Library? Or anybody that is working on it?**
2. **Would any of the above implementations qualify for a “proven in use” argument?**


Constructs in our framework used from the Standard Library:
```cpp
std::string
std::vector
std::map
std::unordered_map
std::allocator
std::allocator_traits

std::shared_ptr
std::make_shared
std::unique_ptr
std::make_unique
std::weak_ptr

std::enable_shared_from_this

std::move

std::ostream
std::ostringstream

std::lock_guard
std::mutex
std::shared_future
std::thread::hardware_concurrency
std::this_thread::yield()

std::enable_if
std::false_type
std::is_same
std::declval

std::function
std::bind

std::chrono*

std::numeric_limits

std::shared_future

std::runtime_error
std::invalid_argument

std::int32_t
std::type_index
std::snprintf
```

Print this item

Search Forums

(Advanced Search)

Forum Statistics
» Members: 6,206
» Latest member: nileseo4605
» Forum threads: 1,017
» Forum posts: 2,796

Full Statistics

Online Users
There are currently 172 online users.
» 0 Member(s) | 170 Guest(s)
Bing, UptimeRobot

Latest Threads
Rule 7.0.5, example non-c...
Forum: 4.7 Standard conversions
Last Post: cgpzs
17-04-2025, 12:10 PM
» Replies: 0
» Views: 158
A3-3-2 Contradictory exam...
Forum: AUTOSAR C++:2014 rules
Last Post: cgpzs
31-03-2025, 09:30 AM
» Replies: 2
» Views: 286
16.6.1 clarification
Forum: 4.16 Overloading
Last Post: cgpzs
31-03-2025, 09:29 AM
» Replies: 2
» Views: 272
Rule 9.3.1 - iteration st...
Forum: 4.9 Statements
Last Post: misra cpp
28-03-2025, 01:17 PM
» Replies: 1
» Views: 180
Rule 8.2.8 - why aren't a...
Forum: 4.8 Expressions
Last Post: misra cpp
28-03-2025, 01:05 PM
» Replies: 1
» Views: 198
Typo in Appendix C of MIS...
Forum: 8.10 The essential type model
Last Post: Yordan Naydenov
17-03-2025, 02:58 PM
» Replies: 0
» Views: 158
Adopted modal expressions...
Forum: General Questions
Last Post: Yordan Naydenov
17-03-2025, 09:01 AM
» Replies: 0
» Views: 242
Roadmap to c23 support
Forum: General Questions
Last Post: ACHart
28-02-2025, 03:23 PM
» Replies: 0
» Views: 201
Rule 6.2.1 weak linkage
Forum: 4.6 Basic concepts
Last Post: misra cpp
28-02-2025, 01:04 PM
» Replies: 1
» Views: 259
A8-4-5: Should have an ex...
Forum: AUTOSAR C++:2014 rules
Last Post: misra cpp
21-02-2025, 12:58 PM
» Replies: 3
» Views: 673