#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements.  See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership.  The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License.  You may obtain a copy of the License at
#
#  http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied.  See the License for the
# specific language governing permissions and limitations
# under the License.
#

pkg.name: hw/drivers/rtt
pkg.description: SEGGER RTT target implementation
pkg.author: "Apache Mynewt <dev@mynewt.apache.org>"
pkg.homepage: "http://mynewt.apache.org/"
pkg.keywords:
pkg.deps:
pkg.req_apis: 

pkg.cflags:
    - -DSEGGER_RTT_SECTION=".rtt"

#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements.  See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership.  The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License.  You may obtain a copy of the License at
#
#  http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied.  See the License for the
# specific language governing permissions and limitations
# under the License.
#

pkg.name: hw/drivers/rtt
pkg.description: SEGGER RTT target implementation
pkg.author: "Apache Mynewt <dev@mynewt.apache.org>"
pkg.homepage: "http://mynewt.apache.org/"
pkg.keywords:
pkg.deps:
pkg.req_apis: 

pkg.cflags:
    - -DSEGGER_RTT_SECTION=".rtt"
    - -Wno-array-bounds

Disable spurious warning in optimized build
rtt: Disable spurious warning in optimized build

With only CONSOLE_RTT enabled (other RTT features disabled) there is
only single up/down buffer thus buffer index !=0 is invalid. When
building RTT target code with optimizations enabled GCC emits an "array
subscript is above array bounds" error (-Werror=array-bounds) at line
1422 below because this code is accessed only if BufferIndex is larger
than 0 (thus out of array bounds). However, this will not happen due to
check in line 1419 as MaxNumUpBuffers is set to array size.

1419   if (BufferIndex < (unsigned)_SEGGER_RTT.MaxNumUpBuffers) {
1420     SEGGER_RTT_LOCK();
1421     if (BufferIndex > 0u) {
1422       _SEGGER_RTT.aUp[BufferIndex].sName        = sName;

Since there is external code which we don't want to modify and also
there is no error in code, let's just disable this warning for RTT
package.
