Thread: MISRA Rule 10.1 (blackfin 561 code)

  1. #1
    Registered User
    Join Date
    Jan 2010
    Posts
    13

    MISRA Rule 10.1 (blackfin 561 code)

    Hi,


    My code for running a blackfin DSP uses pointers to registers to set specific register values. (Found in a compiler include file -> cdefBF561.h)


    i.e.


    Code:
    *pSPI_FLG = 0x01;

    however MISRA counts this as an error, "implicit conversion to a different type"


    how can i get around this? any help would be great,


    Matt

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,660
    > pSPI_FLG
    So how is it declared?

    You might try
    0x01u or 0x01ul
    for appropriate unsigned types.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  3. #3
    Registered User
    Join Date
    Jan 2010
    Posts
    13
    declared as
    Code:
    #define pSPI_FLG 	(volatile unsigned short *)SPI_FLG

  4. #4
    Registered User
    Join Date
    Jan 2010
    Posts
    13
    ah sorry think i've got it.

    I just need to make sure i cast values to match that declared for each register.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. << !! Posting Code? Read this First !! >>
    By kermi3 in forum C Programming
    Replies: 0
    Last Post: 10-03-2002, 03:04 PM
  2. Interface Question
    By smog890 in forum C Programming
    Replies: 11
    Last Post: 06-03-2002, 05:06 PM
  3. << !! Posting Code? Read this First !! >>
    By biosx in forum C++ Programming
    Replies: 1
    Last Post: 03-20-2002, 12:51 PM
  4. Replies: 0
    Last Post: 02-21-2002, 06:05 PM
  5. Replies: 4
    Last Post: 01-16-2002, 12:04 AM